Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2014 16:58:36 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r271753 - head/sys/fs/autofs
Message-ID:  <20140918135835.GV2161@kib.kiev.ua>
In-Reply-To: <20140918131216.GA18337@pc5.home>
References:  <201409181033.s8IAXNZ1054205@svn.freebsd.org> <20140918112100.GS2161@kib.kiev.ua> <20140918131216.GA18337@pc5.home>

next in thread | previous in thread | raw e-mail | index | archive | help

--cbsCxbAnPLQXdgdB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Sep 18, 2014 at 03:12:16PM +0200, Edward Tomasz Napierala wrote:
> On 0918T1421, Konstantin Belousov wrote:
> > On Thu, Sep 18, 2014 at 10:33:23AM +0000, Edward Tomasz Napierala wrote:
> > > Author: trasz
> > > Date: Thu Sep 18 10:33:23 2014
> > > New Revision: 271753
> > > URL: http://svnweb.freebsd.org/changeset/base/271753
> > >=20
> > > Log:
> > >   Fix typos.
> > >  =20
> > >   Sponsored by:	The FreeBSD Foundation
> > >=20
> > > Modified:
> > >   head/sys/fs/autofs/autofs.c
> > >=20
> > > Modified: head/sys/fs/autofs/autofs.c
> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> > > --- head/sys/fs/autofs/autofs.c	Thu Sep 18 10:01:56 2014	(r271752)
> > > +++ head/sys/fs/autofs/autofs.c	Thu Sep 18 10:33:23 2014	(r271753)
> > > @@ -430,7 +430,7 @@ autofs_trigger_one(struct autofs_node *a
> > >  			autofs_restore_sigmask(&oldset);
> > >  			if (error !=3D 0) {
> > >  				/*
> > > -				 * XXX: For some reson this returns -1
> > > +				 * XXX: For some reason this returns -1
> > >  				 *	instead of EINTR, wtf?!
> > >  				 */
> > >  				error =3D EINTR;
> > > @@ -542,7 +542,7 @@ autofs_ioctl_request(struct autofs_daemo
> > >  		    &autofs_softc->sc_lock);
> > >  		if (error !=3D 0) {
> > >  			/*
> > > -			 * XXX: For some reson this returns -1 instead
> > > +			 * XXX: For some reason this returns -1 instead
> > >  			 * 	of EINTR, wtf?!
> > >  			 */
> > >  			error =3D EINTR;
> > The -1 is ERESTART, i.e. it is correct error value which indicates that
> > syscall return path must restart the syscall after the trip to userland.
> > This behaviour is controlled by SA_RESTART flag, see sigaction(2).
>=20
> Ah, I didn't realize it's a valid error number.
>=20
> > There are some syscalls, which explicitely deny restarting, mostly to
> > correctly handle timeout values, most prominent is select(2) family.
> >=20
> > The comment above is definitely inappropriate, and translation of EREST=
ART
> > to EINTR may be wrong as well.
>=20
> The whole point of this is to fail the syscall with EINTR.  However,
> I'm not sure what makes cv_wait_sig(9) to return with ERESTART instead
> of EINTR.  Is SA_RESTART set by default?
When SA_RESTART set, interruption of cv_wait_sig() by signal causes
it to return ERESTART instead of EINTR.

Default disposition is either ignoring of signals, or generating core
dump, so question about SA_RESTART does not make sense.  Despite this,
ps_sigintr signal mask of the restartable signals is clear by default,
so typical interrupt causes ERESTART before default termination action
happens.

Can you explain why this matters for autofs code ?  Normal action for
the kernel code is to pass errors from sig_wait class of functions to
upper levels verbatim, except when the timeout must not be restarted.

--cbsCxbAnPLQXdgdB
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJUGuULAAoJEJDCuSvBvK1BPv4P/i1StBas+CT+xt2HHIgPjLDH
aEwE7jvFxBNH7DBSewFfvmc8V9szu+7ydiYhAl+KTZZhHTJF/U+Y2duqiAT/dFZt
q1wVFHqEmzlZx2NfRnjwRRp8dQ1Dh1/umuLCG1S15Ox7o+ov8urotFp635p0T1zA
WkJgZ6q7yMJuoUi15bJw7YWnFCEw5e7s0VHXFx74KmvuNRdIpYxwT2mJdsnvWSgs
OKnx/k/Sz75RCjdDiUYzWJITb+nW6Kfb5IYWbWsglHn57ndULPBEAO1NcZEW//Wz
qvzQRq0y56K08z5D5GxshWEooB4r/osXA0LY/tK5bATTvmbkPZmtQ8y1Bf0NLPE5
74PsuowoQusO96FhXeTgeYc3BH3xohKI/7aIzrKB/Hbx/r0bsM8a4KMFsargHW0Z
qorjeGQUZba/dR1EG52ZKgRZkvewo813TNebb50Qa1vtUW5UNNITE5pooV6w1hfK
e/qzQGeRGx/X0CJWASJ+9DkGrzoVAKcN0hG6xNc33K+k/F/JSCL1P9G09H126Ql8
+dwXI/V8mUc0l10E+i6x3hIGgQ02wohLYl0rDFU7WHheVpGaqdKOLNqLgty83PZO
f2mrLO9i2b46jYVFSDwtc/l0lEx+jIv3ga5lCponzJZS78NvHVcl8Rg1Idfp6S0z
lJRRhlZu0UHq01bldfXD
=kch9
-----END PGP SIGNATURE-----

--cbsCxbAnPLQXdgdB--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140918135835.GV2161>