Skip to content

Commit

Permalink
qemu/9p: Don't ignore error in fid clunk
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kvaneesh authored and Anthony Liguori committed Feb 6, 2013
1 parent facf98a commit a911a18
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions hw/9pfs/virtio-9p.c
Expand Up @@ -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--;
Expand All @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit a911a18

Please sign in to comment.