git: 929acdb19acb - main - fusefs: fix two bugs regarding fcntl file locks

Alan Somers asomers at freebsd.org
Fri Mar 19 21:09:48 UTC 2021


On Fri, Mar 19, 2021 at 2:53 PM Kyle Evans <kevans at freebsd.org> wrote:

> On Thu, Mar 18, 2021 at 6:09 PM Alan Somers <asomers at 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 at FreeBSD.org>
> > AuthorDate: 2021-03-18 20:27:27 +0000
> > Commit:     Alan Somers <asomers at 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 at 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
>

Oh crap.  That's what I get for working from multiple computers, I
suppose.  I'll fix it.  Thanks for letting me know.
-Alan


More information about the dev-commits-src-main mailing list