From owner-freebsd-fs@FreeBSD.ORG Fri Sep 17 19:09:13 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2881106564A for ; Fri, 17 Sep 2010 19:09:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 74D8A8FC15 for ; Fri, 17 Sep 2010 19:09:11 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8HJ97qP089652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Sep 2010 22:09:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8HJ97MO021636; Fri, 17 Sep 2010 22:09:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8HJ97dm021635; Fri, 17 Sep 2010 22:09:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 17 Sep 2010 22:09:07 +0300 From: Kostik Belousov To: "David O'Brien" Message-ID: <20100917190907.GQ2389@deviant.kiev.zoral.com.ua> References: <20100917180738.GA51572@dragon.NUXI.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nWEzmRaGLXxZdI3i" Content-Disposition: inline In-Reply-To: <20100917180738.GA51572@dragon.NUXI.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: [PATCH] replace INVARIANTS+panic() with KASSERT X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 19:09:13 -0000 --nWEzmRaGLXxZdI3i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 17, 2010 at 11:07:38AM -0700, David O'Brien wrote: > This patch changes most of the "asserts" and panic() within > #ifdef INVARIANTS of olden years with KASSERTS. >=20 > In doing so, it also changes some '"%s: blah", "thing"' with just > '"thing: blah"' to make grep'ing easier. >=20 > Some "notyet" code from the early 2000s is also reaped. >=20 > Some sysctls are also added to make it easier to change some diagnostics > values at runtime vs. I believe using the debugger to change them. >=20 > thoughts? > --=20 > -- David (obrien@FreeBSD.org) >=20 >=20 > Index: IVs/ffs/ffs_softdep.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 > --- ufs/ffs/ffs_softdep.c (revision 212799) > +++ ufs/ffs/ffs_softdep.c (working copy) > @@ -6015,11 +6015,9 @@ handle_complete_freeblocks(freeblks) > vput(vp); > } > =20 > -#ifdef INVARIANTS > - if (freeblks->fb_chkcnt !=3D 0 &&=20 > - ((fs->fs_flags & FS_UNCLEAN) =3D=3D 0 || (flags & LK_NOWAIT) !=3D 0= )) > - printf("handle_workitem_freeblocks: block count\n"); > -#endif /* INVARIANTS */ > + KASSERT(freeblks->fb_chkcnt !=3D 0 && > + ((fs->fs_flags & FS_UNCLEAN) =3D=3D 0 || (flags & LK_NOWAIT) !=3D 0= ), > + ("handle_workitem_freeblocks: block count")); Isn't this reverted ? I believe that all conditions for panics/printf should be reverted in KASSERTs. > =20 > ACQUIRE_LOCK(&lk); > /* > @@ -6089,12 +6087,7 @@ indir_trunc(freework, dbn, lbn) > * a complete copy of the indirect block in memory for our use. > * Otherwise we have to read the blocks in from the disk. > */ > -#ifdef notyet > - bp =3D getblk(freeblks->fb_devvp, dbn, (int)fs->fs_bsize, 0, 0, > - GB_NOCREAT); > -#else > bp =3D incore(&freeblks->fb_devvp->v_bufobj, dbn); > -#endif > ACQUIRE_LOCK(&lk); > if (bp !=3D NULL && (wk =3D LIST_FIRST(&bp->b_dep)) !=3D NULL) { > if (wk->wk_type !=3D D_INDIRDEP || > @@ -6109,10 +6102,6 @@ indir_trunc(freework, dbn, lbn) > ump->um_numindirdeps -=3D 1; > FREE_LOCK(&lk); > } else { > -#ifdef notyet > - if (bp) > - brelse(bp); > -#endif Please leave both notyet blocks in indir_trunc() as is. There are patches in progress that change this fragments, and you supposedly seen them. --nWEzmRaGLXxZdI3i Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyTvNMACgkQC3+MBN1Mb4iaoACgo9laYXI+5727zodwTlog26pl 3U8AoISPP2jXWjGF4a6+1qQZa1CzrI85 =ERrv -----END PGP SIGNATURE----- --nWEzmRaGLXxZdI3i--