From owner-freebsd-fs@FreeBSD.ORG Sun Sep 19 01:08:02 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 A6374106564A; Sun, 19 Sep 2010 01:08:02 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 546768FC15; Sun, 19 Sep 2010 01:08:02 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o8J18203093890; Sat, 18 Sep 2010 18:08:02 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o8J182Gf093889; Sat, 18 Sep 2010 18:08:02 -0700 (PDT) (envelope-from obrien) Date: Sat, 18 Sep 2010 18:08:02 -0700 From: "David O'Brien" To: Pawel Jakub Dawidek Message-ID: <20100919010802.GC93245@dragon.NUXI.org> References: <20100917180738.GA51572@dragon.NUXI.org> <20100917191609.GA1902@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100917191609.GA1902@garage.freebsd.pl> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) 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 Reply-To: obrien@FreeBSD.org List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 01:08:02 -0000 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)