Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Aug 2023 13:25:28 -0400
From:      J David <j.david.lists@gmail.com>
To:        Rick Macklem <rick.macklem@gmail.com>
Cc:        FreeBSD FS <freebsd-fs@freebsd.org>
Subject:   Re: NFS client hang on 13.2-RELEASE-p2 on file locking / wrong interface selected
Message-ID:  <CABXB=RRgyDzZDKPgxL6fwJCbrnyK-JR%2B1nAS3nYpW95_RN6g=A@mail.gmail.com>
In-Reply-To: <CAM5tNy5o44W7qc=DuX75y9C7SME8nfmWJ1DxThHmLTV-FENP4Q@mail.gmail.com>
References:  <CABXB=RTGZ-4MDB7MBoDMzGU6K3xnVU8e7gxkzpGkA2sQ-Sw0Xw@mail.gmail.com> <CAM5tNy5o44W7qc=DuX75y9C7SME8nfmWJ1DxThHmLTV-FENP4Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 24, 2023 at 10:02=E2=80=AFAM Rick Macklem <rick.macklem@gmail.c=
om> wrote:
> Otherwise consider switching the mounts to NFSv4.1/4.2.

Unfortunately, NFSv4 is worse.

Under NFSv4.2, attempts to lock files that previously did not exist on
NFS servers work, but any attempt to lock an existing file, regardless
of permissions, inexplicably fails with "Permission denied."

E.g.:

$ lockf -k x sleep 3 && echo OK
OK
$ lockf -k x sleep 3 && echo OK
lockf: cannot open x: Permission denied
$ rm x
$ lockf -k x sleep 3 && echo OK
OK
$ ktrace lockf -k x sleep 3 && echo OK
lockf: cannot open x: Permission denied
$ echo "what" >x
$ cat x
what

>From ktrace:

 98614 lockf    CALL
openat(AT_FDCWD,0x295c0979e8f1,0x224<O_RDONLY|O_NONBLOCK|O_EXLOCK|O_CREAT>,=
0666<S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH>)
 98614 lockf    NAMI  "x"
 98614 lockf    RET   openat -1 errno 13 Permission denied

Thanks!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABXB=RRgyDzZDKPgxL6fwJCbrnyK-JR%2B1nAS3nYpW95_RN6g=A>