virtiofsd: do not always set FUSE_FLOCK_LOCKS
PATCH 1/1 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 <[email protected]>
--- contrib/virtiofsd/passthrough_ll.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
contrib/virtiofsd/passthrough_ll.c +10 -4
@@ -440,10 +440,16 @@ static void lo_init(void *userdata,fuse_debug ("lo_init: activating writeback\n" ); conn->want |=FUSE_CAP_WRITEBACK_CACHE ; } -if (lo->flock && conn->capable &FUSE_CAP_FLOCK_LOCKS ) { -if (lo->debug) -fuse_debug ("lo_init: activating flock locks\n" ); - conn->want |=FUSE_CAP_FLOCK_LOCKS ; +if (conn->capable &FUSE_CAP_FLOCK_LOCKS ) { +if (lo->flock) { +if (lo->debug) +fuse_debug ("lo_init: activating flock locks\n" ); + conn->want |=FUSE_CAP_FLOCK_LOCKS ; + }else { +if (lo->debug) +fuse_debug ("lo_init: disabling flock locks\n" ); + conn->want &= ~FUSE_CAP_FLOCK_LOCKS ; + } }/* TODO: shared version support for readdirplus */
Signature · 1 line
1.8.3.1
Quoted 3 lines · Peng Tao
Right now we always enable it regardless of given commandlines. Fix it by setting the flag relying on the
lo->flockbit.
Good catch.
Reviewed-by Liu Bo <[email protected]>
thanks,
-liubo
Quoted 32 lines
Signed-off-by Peng Tao <[email protected]>--- contrib/virtiofsd/passthrough_ll.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)contrib/virtiofsd/passthrough_ll.c +10
-4@@ -440,10 +440,16 @@ static void lo_init(void *userdata,fuse_debug ("lo_init: activating writeback\n" ); conn->want |=FUSE_CAP_WRITEBACK_CACHE ; } -if (lo->flock && conn->capable &FUSE_CAP_FLOCK_LOCKS ) { -if (lo->debug) -fuse_debug ("lo_init: activating flock locks\n" ); - conn->want |=FUSE_CAP_FLOCK_LOCKS ; +if (conn->capable &FUSE_CAP_FLOCK_LOCKS ) { +if (lo->flock) { +if (lo->debug) +fuse_debug ("lo_init: activating flock locks\n" ); + conn->want |=FUSE_CAP_FLOCK_LOCKS ; + }else { +if (lo->debug) +fuse_debug ("lo_init: disabling flock locks\n" ); + conn->want &= ~FUSE_CAP_FLOCK_LOCKS ; + } }/* TODO: shared version support for readdirplus */ Signature · 1 line
1.8.3.1
Dr. David Alan Gilbert
AppliedQuoted 4 lines · * Peng Tao ([email protected]) wrote:
Right now we always enable it regardless of given commandlines. Fix it by setting the flag relying on the
lo->flockbit.Signed-off-by Peng Tao <[email protected]>
Thanks, applied.
Quoted 36 lines
--- contrib/virtiofsd/passthrough_ll.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)contrib/virtiofsd/passthrough_ll.c +10
-4@@ -440,10 +440,16 @@ static void lo_init(void *userdata,fuse_debug ("lo_init: activating writeback\n" ); conn->want |=FUSE_CAP_WRITEBACK_CACHE ; } -if (lo->flock && conn->capable &FUSE_CAP_FLOCK_LOCKS ) { -if (lo->debug) -fuse_debug ("lo_init: activating flock locks\n" ); - conn->want |=FUSE_CAP_FLOCK_LOCKS ; +if (conn->capable &FUSE_CAP_FLOCK_LOCKS ) { +if (lo->flock) { +if (lo->debug) +fuse_debug ("lo_init: activating flock locks\n" ); + conn->want |=FUSE_CAP_FLOCK_LOCKS ; + }else { +if (lo->debug) +fuse_debug ("lo_init: disabling flock locks\n" ); + conn->want &= ~FUSE_CAP_FLOCK_LOCKS ; + } }/* TODO: shared version support for readdirplus */ Signature · 6 lines
1.8.3.1 _______________________________________________ Virtio-fs mailing list [email protected] https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK