[Virtio-fs] [PATCH] virtiofsd: do not always set FUSE_FLOCK_LOCKS
Dr. David Alan Gilbert
dgilbert at redhat.com
Mon Aug 5 16:16:43 UTC 2019
* Peng Tao (tao.peng at linux.alibaba.com) wrote:
> 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 at linux.alibaba.com>
Thanks, applied.
> ---
> contrib/virtiofsd/passthrough_ll.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
> index a81c01d..be75cb8 100644
> --- a/contrib/virtiofsd/passthrough_ll.c
> +++ b/contrib/virtiofsd/passthrough_ll.c
> @@ -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 */
>
> --
> 1.8.3.1
>
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs at redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / dgilbert at redhat.com / Manchester, UK
More information about the Virtio-fs
mailing list