aboutsummaryrefslogtreecommitdiff
path: root/tools/virtiofsd
diff options
context:
space:
mode:
authorPeng Tao <tao.peng@linux.alibaba.com>2019-08-02 19:12:23 +0800
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-01-23 16:41:37 +0000
commite468d4af5f5192ab33283464a9f6933044ce47f7 (patch)
treece5b30820b7f756be45128a4fd5a91666118085a /tools/virtiofsd
parentc241aa9457d88c6a0d027f48fadfed131646bce3 (diff)
downloadqemu-e468d4af5f5192ab33283464a9f6933044ce47f7.zip
qemu-e468d4af5f5192ab33283464a9f6933044ce47f7.tar.gz
qemu-e468d4af5f5192ab33283464a9f6933044ce47f7.tar.bz2
virtiofsd: do not always set FUSE_FLOCK_LOCKS
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 <tao.peng@linux.alibaba.com> Reviewed-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd')
-rw-r--r--tools/virtiofsd/passthrough_ll.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index ab16135..ccbbec1 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -546,9 +546,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) {