summaryrefslogtreecommitdiffstats
path: root/hw/9pfs
diff options
context:
space:
mode:
authorAneesh Kumar K.V2013-02-05 06:57:46 +0100
committerAnthony Liguori2013-02-06 15:29:50 +0100
commita911a182a6bfd3b0257b13f862b0d4fbd9392715 (patch)
tree87de08a95d2973d10ff984e36baca6266caffa06 /hw/9pfs
parentqemu/iovec: Don't assert if sbytes is zero (diff)
downloadqemu-a911a182a6bfd3b0257b13f862b0d4fbd9392715.tar.gz
qemu-a911a182a6bfd3b0257b13f862b0d4fbd9392715.tar.xz
qemu-a911a182a6bfd3b0257b13f862b0d4fbd9392715.zip
qemu/9p: Don't ignore error in fid clunk
We use the clunk request to do the actual xattr operation. So don't ignore the error value for fid clunk. Security model "none" don't support posix acl. Without this patch guest won't get EOPNOTSUPP error on setxattr("system.posix_acl_access") Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/9pfs')
-rw-r--r--hw/9pfs/virtio-9p.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index b795839620..d3ea820eae 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -327,7 +327,7 @@ static int free_fid(V9fsPDU *pdu, V9fsFidState *fidp)
return retval;
}
-static void put_fid(V9fsPDU *pdu, V9fsFidState *fidp)
+static int put_fid(V9fsPDU *pdu, V9fsFidState *fidp)
{
BUG_ON(!fidp->ref);
fidp->ref--;
@@ -348,8 +348,9 @@ static void put_fid(V9fsPDU *pdu, V9fsFidState *fidp)
pdu->s->migration_blocker = NULL;
}
}
- free_fid(pdu, fidp);
+ return free_fid(pdu, fidp);
}
+ return 0;
}
static V9fsFidState *clunk_fid(V9fsState *s, int32_t fid)
@@ -1537,9 +1538,10 @@ static void v9fs_clunk(void *opaque)
* free the fid.
*/
fidp->ref++;
- err = offset;
-
- put_fid(pdu, fidp);
+ err = put_fid(pdu, fidp);
+ if (!err) {
+ err = offset;
+ }
out_nofid:
complete_pdu(s, pdu, err);
}