[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 094/104] virtiofsd: do not always set FUSE_FLOCK_LOCKS
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH 094/104] virtiofsd: do not always set FUSE_FLOCK_LOCKS |
Date: |
Thu, 12 Dec 2019 16:38:54 +0000 |
From: Peng Tao <address@hidden>
Right now we always enable it regardless of given commandlines.
Fix it by setting the flag relying on the lo->flock bit.
Signed-off-by: Peng Tao <address@hidden>
---
tools/virtiofsd/passthrough_ll.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 8f4ab8351c..cf6b548eee 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -548,9 +548,14 @@ static void lo_init(void *userdata, struct fuse_conn_info
*conn)
fuse_log(FUSE_LOG_DEBUG, "lo_init: activating writeback\n");
conn->want |= FUSE_CAP_WRITEBACK_CACHE;
}
- if (lo->flock && conn->capable & FUSE_CAP_FLOCK_LOCKS) {
- fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
- conn->want |= FUSE_CAP_FLOCK_LOCKS;
+ if (conn->capable & FUSE_CAP_FLOCK_LOCKS) {
+ if (lo->flock) {
+ fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
+ conn->want |= FUSE_CAP_FLOCK_LOCKS;
+ } else {
+ fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling flock locks\n");
+ conn->want &= ~FUSE_CAP_FLOCK_LOCKS;
+ }
}
if (conn->capable & FUSE_CAP_POSIX_LOCKS) {
--
2.23.0
- [PATCH 086/104] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy(), (continued)
- [PATCH 086/104] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy(), Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 085/104] virtiofsd: Support remote posix locks, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 087/104] virtiofsd: prevent fv_queue_thread() vs virtio_loop() races, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 089/104] virtiofsd: prevent races with lo_dirp_put(), Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 088/104] virtiofsd: make lo_release() atomic, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 091/104] libvhost-user: Fix some memtable remap cases, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 090/104] virtiofsd: rename inode->refcount to inode->nlookup, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 092/104] virtiofsd: add man page, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 094/104] virtiofsd: do not always set FUSE_FLOCK_LOCKS,
Dr. David Alan Gilbert (git) <=
- [PATCH 095/104] virtiofsd: convert more fprintf and perror to use fuse log infra, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 093/104] virtiofsd: introduce inode refcount to prevent use-after-free, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 096/104] virtiofsd: Reset O_DIRECT flag during file open, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 097/104] virtiofsd: Fix data corruption with O_APPEND wirte in writeback mode, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 098/104] virtiofsd: add definition of fuse_buf_writev(), Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 099/104] virtiofsd: use fuse_buf_writev to replace fuse_buf_write for better performance, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 102/104] virtiofsd: fix lo_destroy() resource leaks, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 103/104] virtiofsd: add --thread-pool-size=NUM option, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 101/104] virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 100/104] virtiofsd: process requests in a thread pool, Dr. David Alan Gilbert (git), 2019/12/12