Date: Fri, 17 Sep 2010 21:16:09 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: David O'Brien <obrien@freebsd.org> Cc: freebsd-fs@freebsd.org Subject: Re: [PATCH] replace INVARIANTS+panic() with KASSERT Message-ID: <20100917191609.GA1902@garage.freebsd.pl> In-Reply-To: <20100917180738.GA51572@dragon.NUXI.org> References: <20100917180738.GA51572@dragon.NUXI.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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.
>
> In doing so, it also changes some '"%s: blah", "thing"' with just
> '"thing: blah"' to make grep'ing easier.
>
> Some "notyet" code from the early 2000s is also reaped.
>
> 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.
>
> thoughts?
David, have you actually tried to boot with your patch in place?
Every single change you made is wrong. You converted:
if (cond)
panic("message");
to:
KASSERT(cond, "message");
But assertions don't work this way. It should be:
KASSERT(!cond, "message");
One more thing:
> -#ifdef INVARIANTS
> - if (freeblks->fb_chkcnt != 0 &&
> - ((fs->fs_flags & FS_UNCLEAN) == 0 || (flags & LK_NOWAIT) != 0))
> - printf("handle_workitem_freeblocks: block count\n");
> -#endif /* INVARIANTS */
> + KASSERT(freeblks->fb_chkcnt != 0 &&
> + ((fs->fs_flags & FS_UNCLEAN) == 0 || (flags & LK_NOWAIT) != 0),
> + ("handle_workitem_freeblocks: block count"));
You replaced printf() with KASSERT(9) here, not panic(9).
--
Pawel Jakub Dawidek http://www.wheelsystems.com
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)
iEYEARECAAYFAkyTvnkACgkQForvXbEpPzRrlgCgvcS7Mgq5v52ct5Vc57L2+U8/
8lsAoJBYLkOrgdTymPVWqZVrsYuH+jOH
=ASuH
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100917191609.GA1902>
