diff options
author | Gabriel de Perthuis | 2013-05-10 19:53:28 +0200 |
---|---|---|
committer | Aneesh Kumar K.V | 2013-05-28 11:53:12 +0200 |
commit | db431f6adc881a0758512cd765b3108209013512 (patch) | |
tree | 511e6941fab20b72140bf38b1bdb486d21426252 /hw/9pfs/cofile.c | |
parent | hw/9pfs: Use O_NOFOLLOW when opening files on server (diff) | |
download | qemu-db431f6adc881a0758512cd765b3108209013512.tar.gz qemu-db431f6adc881a0758512cd765b3108209013512.tar.xz qemu-db431f6adc881a0758512cd765b3108209013512.zip |
hw/9pfs: Be robust against paths without FS_IOC_GETVERSION
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 <g2p.code@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/cofile.c')
-rw-r--r-- | hw/9pfs/cofile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c index 2efebf3571..194c1306c6 100644 --- a/hw/9pfs/cofile.c +++ b/hw/9pfs/cofile.c @@ -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; } |