From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:58:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B08F9269; Thu, 18 Sep 2014 13:58:41 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37E4594C; Thu, 18 Sep 2014 13:58:41 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8IDwaMW037676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2014 16:58:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8IDwaMW037676 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8IDwaUV037675; Thu, 18 Sep 2014 16:58:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Sep 2014 16:58:36 +0300 From: Konstantin Belousov 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> References: <201409181033.s8IAXNZ1054205@svn.freebsd.org> <20140918112100.GS2161@kib.kiev.ua> <20140918131216.GA18337@pc5.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cbsCxbAnPLQXdgdB" Content-Disposition: inline In-Reply-To: <20140918131216.GA18337@pc5.home> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 13:58:41 -0000 --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--