aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/cofile.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2012-01-19 12:21:11 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2012-01-19 12:21:11 +0530
commit2c30dd744aa02d31a8a3b87daaba0b2cb774f346 (patch)
tree6546809cbe5e220c5d6710170ff512de265b1566 /hw/9pfs/cofile.c
parent8c4ec5c0269bda18bb777a64b2008088d1c632dc (diff)
downloadqemu-2c30dd744aa02d31a8a3b87daaba0b2cb774f346.zip
qemu-2c30dd744aa02d31a8a3b87daaba0b2cb774f346.tar.gz
qemu-2c30dd744aa02d31a8a3b87daaba0b2cb774f346.tar.bz2
hw/9pfs: Add new security model mapped-file.
This enable us to do passthrough equivalent security model on NFS directory. NFS server mostly do root squashing and don't support xattr. Hence we cannot use 'passthrough' or 'mapped' security model Also added "mapped-xattr" security to indicate earlier "mapped" security model Older name is still supported. POSIX rules regarding ctime update on chmod are not followed by this security model. 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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c
index b15838c..9345aae 100644
--- a/hw/9pfs/cofile.c
+++ b/hw/9pfs/cofile.c
@@ -76,6 +76,20 @@ int v9fs_co_fstat(V9fsPDU *pdu, V9fsFidState *fidp, struct stat *stbuf)
err = -errno;
}
});
+ /*
+ * Some FS driver (local:mapped-file) can't support fetching attributes
+ * using file descriptor. Use Path name in that case.
+ */
+ if (err == -EOPNOTSUPP) {
+ err = v9fs_co_lstat(pdu, &fidp->path, stbuf);
+ if (err == -ENOENT) {
+ /*
+ * fstat on an unlinked file. Work with partial results
+ * returned from s->ops->fstat
+ */
+ err = 0;
+ }
+ }
return err;
}