Skip to contentSkip to conversation

9p: Be robust against paths without FS_IOC_GETVERSION

PATCH New Gabriel de Perthuis 1 participant 1 message May 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 9p: Be robust against paths without FS_IOC_GETVERSION

The current implementation checked for supported filesystems at mount time, but actual support depends on the path. Don't error out when finding unversioned paths.

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

---
 hw/9pfs/cofile.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/9pfs/cofile.c +4 -0
index 2efebf3..194c130 100644
@@ -36,10 +36,14 @@ int v9fs_co_st_gen(V9fsPDU *pdu, V9fsPath *path, mode_t st_mode,
                     err = -errno;
                 }
             });
         v9fs_path_unlock(s);
     }
+    /* The ioctl may not be supported depending on the path */
+    if (err == -ENOTTY) {
+        err = 0;
+    }
     return err;
 }
 
 int v9fs_co_lstat(V9fsPDU *pdu, V9fsPath *path, struct stat *stbuf)
 {
Signature · 1 line
1.8.2.1.419.ga0b97c6