[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/8] hw/9pfs: Fix error handling in local_mknod
From: |
Aneesh Kumar K.V |
Subject: |
[Qemu-devel] [PATCH 1/8] hw/9pfs: Fix error handling in local_mknod |
Date: |
Thu, 20 Oct 2011 21:47:33 +0530 |
From: "Aneesh Kumar K.V" <address@hidden>
Update local_chown to remove unnecessary if loop
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
hw/9pfs/virtio-9p-local.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
index d561de8..b611681 100644
--- a/hw/9pfs/virtio-9p-local.c
+++ b/hw/9pfs/virtio-9p-local.c
@@ -281,7 +281,7 @@ static int local_mknod(FsContext *fs_ctx, V9fsPath
*dir_path,
if (err == -1) {
goto out;
}
- local_set_xattr(rpath(fs_ctx, path, buffer), credp);
+ err = local_set_xattr(rpath(fs_ctx, path, buffer), credp);
if (err == -1) {
serrno = errno;
goto err_end;
@@ -551,15 +551,12 @@ static int local_chown(FsContext *fs_ctx, V9fsPath
*fs_path, FsCred *credp)
char *path = fs_path->data;
if ((credp->fc_uid == -1 && credp->fc_gid == -1) ||
- (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH)) {
- return lchown(rpath(fs_ctx, path, buffer), credp->fc_uid,
- credp->fc_gid);
+ (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) ||
+ (fs_ctx->export_flags & V9FS_SM_NONE)) {
+ return lchown(rpath(fs_ctx, path, buffer),
+ credp->fc_uid, credp->fc_gid);
} else if (fs_ctx->export_flags & V9FS_SM_MAPPED) {
return local_set_xattr(rpath(fs_ctx, path, buffer), credp);
- } else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) ||
- (fs_ctx->export_flags & V9FS_SM_NONE)) {
- return lchown(rpath(fs_ctx, path, buffer), credp->fc_uid,
- credp->fc_gid);
}
return -1;
}
--
1.7.5.4
- [Qemu-devel] [PATCH 0/8] VirtFS update 7 for review, Aneesh Kumar K.V, 2011/10/20
- [Qemu-devel] [PATCH 2/8] configure: Update configure so that open_by_handle_at check returns correct value, Aneesh Kumar K.V, 2011/10/20
- [Qemu-devel] [PATCH 1/8] hw/9pfs: Fix error handling in local_mknod,
Aneesh Kumar K.V <=
- [Qemu-devel] [PATCH 7/8] qemu-queue: Introduce QLIST_INSERT_HEAD_RCU and dummy RCU wrappers., Aneesh Kumar K.V, 2011/10/20
- [Qemu-devel] [PATCH 3/8] qemu: Add opt_set_bool functionality, Aneesh Kumar K.V, 2011/10/20
- [Qemu-devel] [PATCH 8/8] hw/9pfs: Replace rwlocks with RCU variants of interfaces., Aneesh Kumar K.V, 2011/10/20
- [Qemu-devel] [PATCH 5/8] hw/9pfs: Abstract open state of fid to V9fsFidOpenState, Aneesh Kumar K.V, 2011/10/20
- [Qemu-devel] [PATCH 6/8] hw/9pfs: Add synthetic file system support using 9p, Aneesh Kumar K.V, 2011/10/20
- [Qemu-devel] [PATCH 4/8] hw/9pfs: Read-only support for 9p export, Aneesh Kumar K.V, 2011/10/20