Date: Fri, 19 Mar 2021 15:53:16 -0500 From: Kyle Evans <kevans@freebsd.org> To: Alan Somers <asomers@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org Subject: Re: git: 929acdb19acb - main - fusefs: fix two bugs regarding fcntl file locks Message-ID: <CACNAnaHncxFxU3GwycZX=gienCi3gMQNXAQE=JJHF_H8v9-8yg@mail.gmail.com> In-Reply-To: <202103182309.12IN9nXd002407@gitrepo.freebsd.org> References: <202103182309.12IN9nXd002407@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 18, 2021 at 6:09 PM Alan Somers <asomers@freebsd.org> wrote: > > The branch main has been updated by asomers: > > URL: https://cgit.FreeBSD.org/src/commit/?id=929acdb19acb67cc0e6ee5439df98e28a84d4772 > > commit 929acdb19acb67cc0e6ee5439df98e28a84d4772 > Author: Alan Somers <asomers@FreeBSD.org> > AuthorDate: 2021-03-18 20:27:27 +0000 > Commit: Alan Somers <asomers@FreeBSD.org> > CommitDate: 2021-03-18 23:09:10 +0000 > > fusefs: fix two bugs regarding fcntl file locks > > 1) F_SETLKW (blocking) operations would be sent to the FUSE server as > F_SETLK (non-blocking). > > 2) Release operations, F_SETLK with lk_type = F_UNLCK, would simply > return EINVAL. > > PR: 253500 > Reported by: John Millikin <jmillikin@gmail.com> > MFC after: 2 weeks > --- > sys/fs/fuse/fuse_vnops.c | 10 +++++++--- > tests/sys/fs/fusefs/flush.cc | 12 ++++++++++- > tests/sys/fs/fusefs/locks.cc | 45 +++++++++++++++++++++++++++++++++++++++++- > tests/sys/fs/fusefs/release.cc | 12 ++++++++++- > 4 files changed, 73 insertions(+), 6 deletions(-) > > diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c > index 5bbde1e278c9..cdbc42f5adf4 100644 > --- a/sys/fs/fuse/fuse_vnops.c > +++ b/sys/fs/fuse/fuse_vnops.c > @@ -437,10 +437,14 @@ fuse_vnop_advlock(struct vop_advlock_args *ap) > op = FUSE_GETLK; > break; > case F_SETLK: > - op = FUSE_SETLK; > + if (flags & F_WAIT) > + op = FUSE_SETLKW; > + else > + op = FUSE_SETLK; > break; > - case F_SETLKW: > - op = FUSE_SETLKW; > + case F_UNLCK: > + op = FUSE_SETLK; > + flags |= F_UNLCK; > break; > default: > return EINVAL; Hi, The committed version of this appears to have brought back the redundant assignment to `flags` Thanks, Kyle Evans
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaHncxFxU3GwycZX=gienCi3gMQNXAQE=JJHF_H8v9-8yg>