public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Brian Foster <bfoster@redhat.com>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH 4/4] xfs: remove rbpp check from xfs_rtmodify_summary_int
Date: Sat, 23 Aug 2014 18:50:14 -0500	[thread overview]
Message-ID: <53F928B6.7080308@sandeen.net> (raw)
In-Reply-To: <20140822132004.GD3915@laptop.bfoster>

On 8/22/14, 8:20 AM, Brian Foster wrote:
> On Thu, Aug 21, 2014 at 08:03:19PM -0500, Eric Sandeen wrote:
>> rbpp is always passed into xfs_rtmodify_summary
>> and xfs_rtget_summary, so there is no need to
>> test for it in xfs_rtmodify_summary_int.
>>
> 
> Looks fine, but this is also called through a variety of twisty paths.
> Could we add a top-level error check or assert?

We could, though it'll oops pretty fast if we don't send rbpp anyway.
An ASSERT might be decent for documentation, though...

-Eric

> Brian
> 
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
>> index 50e3b93..7c818f1 100644
>> --- a/fs/xfs/libxfs/xfs_rtbitmap.c
>> +++ b/fs/xfs/libxfs/xfs_rtbitmap.c
>> @@ -460,7 +460,7 @@ xfs_rtmodify_summary_int(
>>  	/*
>>  	 * If we have an old buffer, and the block number matches, use that.
>>  	 */
>> -	if (rbpp && *rbpp && *rsb == sb)
>> +	if (*rbpp && *rsb == sb)
>>  		bp = *rbpp;
>>  	/*
>>  	 * Otherwise we have to get the buffer.
>> @@ -469,7 +469,7 @@ xfs_rtmodify_summary_int(
>>  		/*
>>  		 * If there was an old one, get rid of it first.
>>  		 */
>> -		if (rbpp && *rbpp)
>> +		if (*rbpp)
>>  			xfs_trans_brelse(tp, *rbpp);
>>  		error = xfs_rtbuf_get(mp, tp, sb, 1, &bp);
>>  		if (error) {
>> @@ -478,10 +478,8 @@ xfs_rtmodify_summary_int(
>>  		/*
>>  		 * Remember this buffer and block for the next call.
>>  		 */
>> -		if (rbpp) {
>> -			*rbpp = bp;
>> -			*rsb = sb;
>> -		}
>> +		*rbpp = bp;
>> +		*rsb = sb;
>>  	}
>>  	/*
>>  	 * Point to the summary information, modify/log it, and/or copy it out.
>> @@ -493,14 +491,8 @@ xfs_rtmodify_summary_int(
>>  		*sp += delta;
>>  		xfs_trans_log_buf(tp, bp, first, first + sizeof(*sp) - 1);
>>  	}
>> -	if (sum) {
>> -		/*
>> -		 * Drop the buffer if we're not asked to remember it.
>> -		 */
>> -		if (!rbpp)
>> -			xfs_trans_brelse(tp, bp);
>> +	if (sum)
>>  		*sum = *sp;
>> -	}
>>  	return 0;
>>  }
>>  
>>
>>
>> _______________________________________________
>> xfs mailing list
>> xfs@oss.sgi.com
>> http://oss.sgi.com/mailman/listinfo/xfs
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2014-08-23 23:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22  0:51 [PATCH 0/4] xfs: more code refactoring Eric Sandeen
2014-08-22  0:55 ` [PATCH 1/4] xfs: check resblks before calling xfs_dir_canenter Eric Sandeen
2014-08-22 13:19   ` Brian Foster
2014-08-29  0:59   ` Christoph Hellwig
2014-08-22  0:58 ` [PATCH 2/4] xfs: combine xfs_dir_canenter into xfs_dir_createname Eric Sandeen
2014-08-22 13:19   ` Brian Foster
2014-08-29  1:00   ` Christoph Hellwig
2014-08-29  2:14   ` [PATCH 2/4 V2] " Eric Sandeen
2014-08-22  1:00 ` [PATCH 3/4] xfs: combine xfs_rtmodify_summary and xfs_rtget_summary Eric Sandeen
2014-08-22 13:19   ` Brian Foster
2014-08-22 15:01     ` Eric Sandeen
2014-08-22 15:23       ` Eric Sandeen
2014-08-22  1:03 ` [PATCH 4/4] xfs: remove rbpp check from xfs_rtmodify_summary_int Eric Sandeen
2014-08-22 13:20   ` Brian Foster
2014-08-23 23:50     ` Eric Sandeen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F928B6.7080308@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=bfoster@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox