Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jul 2014 19:18:01 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Mateusz Guzik <mjg@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r268570 - head/sys/kern
Message-ID:  <20140712161801.GS93733@kib.kiev.ua>
In-Reply-To: <201407121535.s6CFZ42f063120@svn.freebsd.org>
References:  <201407121535.s6CFZ42f063120@svn.freebsd.org>

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

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

On Sat, Jul 12, 2014 at 03:35:04PM +0000, Mateusz Guzik wrote:
> Author: mjg
> Date: Sat Jul 12 15:35:04 2014
> New Revision: 268570
> URL: http://svnweb.freebsd.org/changeset/base/268570
>=20
> Log:
>   Clear nonblock and async on devctl close instaed of open.
>  =20
>   This is a purely cosmetic change.
>=20
> Modified:
>   head/sys/kern/subr_bus.c
>=20
> Modified: head/sys/kern/subr_bus.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/kern/subr_bus.c	Sat Jul 12 15:19:30 2014	(r268569)
> +++ head/sys/kern/subr_bus.c	Sat Jul 12 15:35:04 2014	(r268570)
> @@ -438,8 +438,6 @@ devopen(struct cdev *dev, int oflags, in
>  	}
>  	/* move to init */
>  	devsoftc.inuse =3D 1;
> -	devsoftc.nonblock =3D 0;
> -	devsoftc.async =3D 0;
>  	mtx_unlock(&devsoftc.mtx);
>  	return (0);
>  }
> @@ -450,6 +448,8 @@ devclose(struct cdev *dev, int fflag, in
> =20
>  	mtx_lock(&devsoftc.mtx);
>  	devsoftc.inuse =3D 0;
> +	devsoftc.nonblock =3D 0;
> +	devsoftc.async =3D 0;
>  	cv_broadcast(&devsoftc.cv);
>  	funsetown(&devsoftc.sigio);
>  	mtx_unlock(&devsoftc.mtx);
This is not pure cosmetic.  devctl does not track closes, so opens are
not matched with close calls.  Now any close clears nonblock and async,
which is not how it was done before.  Tracking close calls does not
work reliably.

FWIW, I think that both old and new behaviour are bugs, and I am not
sure why changing one for another (instead of fix).

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

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

iQIcBAEBAgAGBQJTwV+4AAoJEJDCuSvBvK1BBGkP+wZV2gDH+kEENgBk/6ufXcEo
MTV988mSl44Wit86JSQcAVJ3CRosp39WbqQsHcWnQdNViWl8bDw9AWGkVZ52mF04
7JFlRnTF7ZDYQTIM2l43xgtiGom+CesfdAjucSrfgm0ESfrYVPjrWgpV4c1KmP5z
i3nNWG9mUujZG0tVkLzrFt888XW4mFtEFP5MVfYP7jTaoZTkWAY4M0ELeF0FdCSw
OTVxDNknBAgvozTEiI8Q+ekBcDDd/fNFnTr5vJQ3V1YD9ZqyWLp8mHZRHwhG9ML7
MkHmf4EEk6Od0pFfE+RjM9vcEHsmyJLLP5JFSRtO0dohw847dn7J4JzFFlmdoA8M
1FXh4OHIOcTwTTEax8hWYrS3Oif30ZSGqPNmwcB3sy937RTfVM49Z6SvS4QTbDiJ
FWNRWbVtkNnuYds5rF08qAHgBUWyp0NfFuDHOqM3a5D4dDexsl/Vu5WF1ZoIXluT
L0iFLnr+Z1XFb6HVqRZ5outsp2AKYSTT6m431Xv1gcafeo5LW7b6OLef+02j33p4
5TomfNHvMDxLcaJusnIdeNmplxDwpaHSyXa9W/OKLc4L0lDgUounGZTuhcvhs0fY
dMHzd/t/tby7FgzdbR/rU5DrFOd4L4x0d7AsNnCd++R4l55gjHTT6GfCrD0CohJz
0K9Hwe40Ug3YgqpxE/0b
=8HQD
-----END PGP SIGNATURE-----

--MeyeQYaqfWO5VP1p--



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