xfs
[Top] [All Lists]

Re: [PATCH] xfs: undo block reservation correctly in xfs_trans_reserve()

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: undo block reservation correctly in xfs_trans_reserve()
From: Eryu Guan <guaneryu@xxxxxxxxx>
Date: Tue, 6 Sep 2016 19:50:45 +0800
Cc: linux-xfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TKJt/bvDCm1LS43GBxeQ/eZF7PkO4JlK/dH/ZCA/uXE=; b=fWhONPmSZ568Z/OMYQvO0HerEfUxbmgLwiN3gGoIQ3fCAoGqexXGjArXGEfKgTOs0K J+Gth5sIcH6dUWWR2bphxrAay3juwoOFe/mabgkx4tuBL6KMGOT5qMW5bEVjHHkJEpL/ 5F9Au6EkPqLsCYs22QH/WopPHHTCzTVzBl8LK56YNpcF8FLcIErL8XdETcpUjjk1zjom mrRBRRIhCkLlIpzsDQn+1ZLi8EFeP8EkmGddl4ZAGYH+RAiAZak6uEwdkXFKxJmZ7t2Z vYtijbW5alZCGmcPedgPTfbRJbDrrbf6r4Y4pYn/mATEcj1UvcObX0oKWfxUxMx4BnTU cTqw==
In-reply-to: <20160906084828.GK30056@dastard>
References: <1473149039-30487-1-git-send-email-guaneryu@xxxxxxxxx> <20160906084828.GK30056@dastard>
User-agent: Mutt/1.6.1 (2016-04-27)
On Tue, Sep 06, 2016 at 06:48:28PM +1000, Dave Chinner wrote:
> On Tue, Sep 06, 2016 at 04:03:59PM +0800, Eryu Guan wrote:
> > "blocks" should be added back to fdblocks at undo time, not taken
> > away, i.e. the minus sign should not be used.
> 
> You've described the code change you made, not about the problem you
> hit and are fixing.
> 
> i.e. I've got no idea how you found this, or even how to identify a
> system that is tripping over this problem. By describing how you
> found it and the symptoms being displayed, I'll learn from you how
> to identify the problem and hence, in future, be able to identify
> systems that are tripping over the problem, too.

Usually I will describe the symptoms, how I hit the problem and the
reproducer in commit log in details, but this time I found this bug by
code inspection, I don't have these information. I should have mentioned
this info too.

> 
> > Fixes: 0d485ada404b ("xfs: use generic percpu counters for free block 
> > counter")
> 
> I really don't like this sort of "annotation". It wrongly implies
> the commit was broken (it wasn't) and there's no scope for stating
> the problem context. i.e.  that the problem is a minor regression in
> a rarely travelled corner case that is unlikely to affect production
> machines in any significant way. It's better to describe things with
> all the relevant context:
> 
> "This is a regression introduced in commit ... and only occurs when
> .... "

Makes sense, will do so.

> 
> > Signed-off-by: Eryu Guan <guaneryu@xxxxxxxxx>
> 
> Not @redhat?

I thought that I'm employed by Red Hat as a QE not a filesystem
developer, all filesystem patches I send reflect my own opinions not my
employer's, so all silly mistakes I made in the patches are under my
personal email too :)

> 
> > ---
> >  fs/xfs/xfs_trans.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
> > index 5f3d33d..011dace 100644
> > --- a/fs/xfs/xfs_trans.c
> > +++ b/fs/xfs/xfs_trans.c
> > @@ -217,7 +217,7 @@ undo_log:
> >  
> >  undo_blocks:
> >     if (blocks > 0) {
> > -           xfs_mod_fdblocks(tp->t_mountp, -((int64_t)blocks), rsvd);
> > +           xfs_mod_fdblocks(tp->t_mountp, ((int64_t)blocks), rsvd);
> 
> Outer () can be dropped, too.

OK.

Thanks for the review!

Eryu

<Prev in Thread] Current Thread [Next in Thread>