Date: Sat, 18 Sep 2010 18:08:02 -0700 From: "David O'Brien" <obrien@FreeBSD.org> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: freebsd-fs@FreeBSD.org Subject: Re: [PATCH] replace INVARIANTS+panic() with KASSERT Message-ID: <20100919010802.GC93245@dragon.NUXI.org> In-Reply-To: <20100917191609.GA1902@garage.freebsd.pl> References: <20100917180738.GA51572@dragon.NUXI.org> <20100917191609.GA1902@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 17, 2010 at 09:16:09PM +0200, Pawel Jakub Dawidek wrote:
> David, have you actually tried to boot with your patch in place?
> Every single change you made is wrong. You converted:
Yes, caught that after extracting the changes from how I was first
testing the change (which had the KASSERT macro as a printf instead of
panic).
I knew I had more testing to go, but wanted to know if folks thought the
changes were positive or if I would get resistance to changing these to
KASSERT()s.
> 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).
Correct. If this is truly an INVARIANTS we should panic.
Should the "#ifdef INVARIANTS" be changed to #ifdef DIAGNOSTIC"?
--
-- David (obrien@FreeBSD.org)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100919010802.GC93245>
