[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] virtiofsd: Allow setxattr operation to directry
From: |
Misono Tomohiro |
Subject: |
[PATCH 2/2] virtiofsd: Allow setxattr operation to directry |
Date: |
Wed, 16 Oct 2019 19:37:54 +0900 |
setxattr to directry fails because lo_setxattr (and lo_remove_xattr)
tries to open any file with O_RDWR even if it is a directory.
Since O_RDONLY is enough for the operation, change O_RDWR flag to
O_RDONLY to fix the problem.
Signed-off-by: Misono Tomohiro <address@hidden>
---
contrib/virtiofsd/passthrough_ll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/virtiofsd/passthrough_ll.c
b/contrib/virtiofsd/passthrough_ll.c
index 645324da58..1b439d58ed 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -2397,7 +2397,7 @@ static void lo_setxattr(fuse_req_t req, fuse_ino_t ino,
const char *name,
}
sprintf(procname, "%i", inode->fd);
- fd = openat(lo->proc_self_fd, procname, O_RDWR|O_NONBLOCK);
+ fd = openat(lo->proc_self_fd, procname, O_RDONLY|O_NONBLOCK);
if (fd < 0) {
saverr = errno;
goto out;
@@ -2446,7 +2446,7 @@ static void lo_removexattr(fuse_req_t req, fuse_ino_t
ino, const char *name)
}
sprintf(procname, "%i", inode->fd);
- fd = openat(lo->proc_self_fd, procname, O_RDWR|O_NONBLOCK);
+ fd = openat(lo->proc_self_fd, procname, O_RDONLY|O_NONBLOCK);
if (fd < 0) {
saverr = errno;
goto out;
--
2.21.0
- [PATCH 0/2] virtiofsd: Two fix for xattr operation, Misono Tomohiro, 2019/10/16
- [PATCH 2/2] virtiofsd: Allow setxattr operation to directry,
Misono Tomohiro <=
- [PATCH 1/2] virtiofsd: Avoid process hang when doing xattr operation to FIFO, Misono Tomohiro, 2019/10/16
- Re: [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation, Stefan Hajnoczi, 2019/10/17
- Re: [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation, Miklos Szeredi, 2019/10/17
- Re: [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation, Stefan Hajnoczi, 2019/10/17
- Re: [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation, Miklos Szeredi, 2019/10/17
- Re: [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation, Miklos Szeredi, 2019/10/18
- Re: [Virtio-fs] [PATCH 0/2] virtiofsd: Two fix for xattr operation, Stefan Hajnoczi, 2019/10/18