* [Virtio-fs] [PATCH] virtiofsd: do not always set FUSE_FLOCK_LOCKS
@ 2019-08-02 11:12 Peng Tao
2019-08-02 23:06 ` Liu Bo
2019-08-05 16:16 ` Dr. David Alan Gilbert
0 siblings, 2 replies; 3+ messages in thread
From: Peng Tao @ 2019-08-02 11:12 UTC (permalink / raw)
To: virtio-fs; +Cc: Peng Tao
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Virtio-fs] [PATCH] virtiofsd: do not always set FUSE_FLOCK_LOCKS
2019-08-02 11:12 [Virtio-fs] [PATCH] virtiofsd: do not always set FUSE_FLOCK_LOCKS Peng Tao
@ 2019-08-02 23:06 ` Liu Bo
2019-08-05 16:16 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Liu Bo @ 2019-08-02 23:06 UTC (permalink / raw)
To: Peng Tao; +Cc: virtio-fs
On Fri, Aug 02, 2019 at 07:12:23PM +0800, Peng Tao wrote:
> Right now we always enable it regardless of given commandlines.
> Fix it by setting the flag relying on the lo->flock bit.
>
Good catch.
Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
thanks,
-liubo
> Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Virtio-fs] [PATCH] virtiofsd: do not always set FUSE_FLOCK_LOCKS
2019-08-02 11:12 [Virtio-fs] [PATCH] virtiofsd: do not always set FUSE_FLOCK_LOCKS Peng Tao
2019-08-02 23:06 ` Liu Bo
@ 2019-08-05 16:16 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2019-08-05 16:16 UTC (permalink / raw)
To: Peng Tao; +Cc: virtio-fs
* Peng Tao (tao.peng@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@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@redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-05 16:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-02 11:12 [Virtio-fs] [PATCH] virtiofsd: do not always set FUSE_FLOCK_LOCKS Peng Tao
2019-08-02 23:06 ` Liu Bo
2019-08-05 16:16 ` Dr. David Alan Gilbert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.