]> Git Repo - qemu.git/commitdiff
hw/9pfs: Be robust against paths without FS_IOC_GETVERSION
authorGabriel de Perthuis <[email protected]>
Fri, 10 May 2013 17:53:28 +0000 (19:53 +0200)
committerAneesh Kumar K.V <[email protected]>
Tue, 28 May 2013 09:53:12 +0000 (15:23 +0530)
9P optionally uses the FS_IOC_GETVERSION ioctl to get information about
a file's version (sometimes called generation number).

The code checks for supported filesystems at mount time, but some paths
may come from other mounted filesystems.

Change it to treat unsupported paths the same as unsupported
filesystems, returning 0 in both cases.

Note: ENOTTY is the error code for an unsupported ioctl.

This fix allows booting a linux kernel with the same / filesystem as the
host; otherwise the boot fails when mounting devtmpfs.

Signed-off-by: Gabriel de Perthuis <[email protected]>
Reviewed-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
hw/9pfs/cofile.c

index 2efebf35710f4fd5dde18774b4bd54d11ec6bf3d..194c1306c665679e601b8a206e6f7817aba719e4 100644 (file)
@@ -38,6 +38,10 @@ int v9fs_co_st_gen(V9fsPDU *pdu, V9fsPath *path, mode_t st_mode,
             });
         v9fs_path_unlock(s);
     }
+    /* The ioctl may not be supported depending on the path */
+    if (err == -ENOTTY) {
+        err = 0;
+    }
     return err;
 }
 
This page took 0.026764 seconds and 4 git commands to generate.