svn commit: r302216 - in head/sys: kern nlm

Konstantin Belousov kostikbel at gmail.com
Mon Jun 27 23:46:36 UTC 2016


On Mon, Jun 27, 2016 at 01:18:48PM -0700, Ngie Cooper wrote:
> On Sun, Jun 26, 2016 at 1:08 PM, Konstantin Belousov <kib at freebsd.org> wrote:
> > Author: kib
> > Date: Sun Jun 26 20:08:42 2016
> > New Revision: 302216
> > URL: https://svnweb.freebsd.org/changeset/base/302216
> >
> > Log:
> >   When sleeping waiting for either local or remote advisory lock,
> >   interrupt sleeps with the ERESTART on the suspension attempts.
> >   Otherwise, single-threading requests are deferred until the locks are
> >   granted for NFS files, which causes hangs.
> >
> >   When retrying local registration of the remotely-granted adv lock,
> >   allow full suspension and check for suspension, for usual reasons.
> >
> >   Reported by:  markj, pho
> >   Reviewed by:  jilles
> >   Tested by:    pho
> >   Sponsored by: The FreeBSD Foundation
> >   MFC after:    2 weeks
> >   Approved by:  re (gjb)
> 
> One of the NetBSD tests seems to be failing now:
> https://jenkins.freebsd.org/job/FreeBSD_HEAD/334/testReport/junit/sys.kern/lockf_test/randlock/
> .

Indeed.  The reason is that TDF_SBDRY + TDF_SERESTART (or TDF_SEINTR)
combination should be treated almost as if TDF_SBDRY is not set, at least
for the purposes of filtering out stops.  It must not allow the real stop
to occur at a protected sleep point, though.

The committed revision lacks updates to kern_sig.c to kick the sleeping
thread in TDF_SERESTART condition to make it runnable to reach boundary.

I attached the distilled case from the NetBSD test below.  Another good
test case to illustrate that is to do in one terminal
	echo 123 >/tmp/1
	lockf /tmp/1 sleep 100000
and in another
	lockf /tmp/1 date
	^Z

This should have failed in similar way on NFS only, before the changes.
The patch attached fixed both cases for me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.patch
Type: text/x-diff
Size: 3316 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160628/3cd4e0c2/attachment.patch>


More information about the svn-src-head mailing list