Date: Fri, 18 Dec 2015 09:47:08 -0500 From: Shawn Webb <shawn.webb@hardenedbsd.org> To: Warner Losh <imp@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292436 - head/sys/geom/sched Message-ID: <20151218144708.GA27589@mutt-hardenedbsd> In-Reply-To: <201512181410.tBIEA0FD099700@repo.freebsd.org> References: <201512181410.tBIEA0FD099700@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 18, 2015 at 02:10:00PM +0000, Warner Losh wrote: > Author: imp > Date: Fri Dec 18 14:10:00 2015 > New Revision: 292436 > URL: https://svnweb.freebsd.org/changeset/base/292436 >=20 > Log: > It turns out that it's OK to sleep in this context, so use M_WAITOK > for the softc for the delay module. > =20 > Noticed by: rpokala@ >=20 > Modified: > head/sys/geom/sched/gs_delay.c >=20 > Modified: head/sys/geom/sched/gs_delay.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/geom/sched/gs_delay.c Fri Dec 18 11:20:50 2015 (r292435) > +++ head/sys/geom/sched/gs_delay.c Fri Dec 18 14:10:00 2015 (r292436) > @@ -201,8 +201,7 @@ g_delay_init(struct g_geom *geom) > { > struct g_delay_softc *sc; > =20 > - /* XXX check whether we can sleep */ > - sc =3D malloc(sizeof *sc, M_GEOM_SCHED, M_NOWAIT | M_ZERO); > + sc =3D malloc(sizeof *sc, M_GEOM_SCHED, M_WAITOK | M_ZERO); > sc->sc_geom =3D geom; > bioq_init(&sc->sc_bioq); > callout_init(&sc->sc_wait, CALLOUT_MPSAFE); Additionally, this fixed a potential NULL dereference bug. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWdBxpAAoJEGqEZY9SRW7u7zMP/RtRB+MMhXK4kkSolcWnkoiH /FYTIqHM7tOuSAnM/GANTapjE9yCNv4QqeCNucY3XNBex4r3mprRmVrX5LVm2Djo ig67b3FUaBN90ix4FBMvw3kuYVEcLzCIiHUWZ+B4FnJJEUrCDUxN26XWoC/VmFlD weCvY1CCE7rqcDI7WjGXC06AOF5oag59liPSCLvbRgTH5DIGjtf01w0vn8wXdKEM xyei8g4C5dqfCzKuhq/2QSj3uSfuTXSBcfaV9aCkwDN4n4Hb+GwtmFyAkGfAp8bD +E016sKJHfSKtSTDrIm+ZisOH0cjk7vSNnnAPBHkUgS++9eafs2FBzjQ0r+ELCpb h/MEKMBXNUBcsJZiasy6Pty/J1uLe0/M6JhG5Snf9CEICm8/bWqHkwPltHnA34YO X9794WLdqinHlr+mwNejzAsIYX6ux+pahuFXPXzAgcVx6EBZ0k0Lg8raL1zLlWT0 MbMPt1qkkCy1iJvAxzyKQUEq8Wtd+Ef4xSpqPel+Zt5kzvTjswHcyEwddDzaGOfL Sb3yyRuOoiteTAXJ10pZbiNOgdyPLO3Kky+fiNErvNTlde0AbskY665oUPDFTvCg FdapM524HHhmN7dk9pWwxG15jgfX8dknfesGLtdAFQylKqR9+LONIQTH1HBULDa5 BLGHsrOk7qAlS0p+byju =soDD -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151218144708.GA27589>