All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Theodore Y Tso <theotso@us.ibm.com>,
	Mingming Cao <cmm@us.ibm.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: Patch for 2.6.25 queue
Date: Sat, 26 Jan 2008 12:03:31 -0500	[thread overview]
Message-ID: <20080126170331.GB13231@mit.edu> (raw)
In-Reply-To: <20080126113849.GA18602@skywalker>

On Sat, Jan 26, 2008 at 05:08:49PM +0530, Aneesh Kumar K.V wrote:
> This diff contain mballoc fixes and update for ext3-4 migrate patch.

I will fold these patches into the patch queue in the proper places
(and adjust other patches as necessary).

> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index a60672c..9de0cdf 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4452,7 +4452,6 @@ do_more:
>  		overflow = bit + count - EXT4_BLOCKS_PER_GROUP(sb);
>  		count -= overflow;
>  	}
> -	put_bh(bitmap_bh);
>  	bitmap_bh = read_block_bitmap(sb, block_group);
>  	if (!bitmap_bh)
>  		goto error_return;

This patch hunk causes a failure due to a botched brelse->put_bh
conversion, but removing it isn't the right fix.  It was there to
avoid a buffer leak on a goto.  So the right fix is to remove the
put_bh() above, but to add one here, circa line 4542 of mballoc.c:

	if (overflow && !err) {
		block += count;
		count = overflow;
+		put_bh(bitmap_bh);
		goto do_more;
	}

And once we do that, we can drop the initialization of bitmap_bh to
NULL, circa line 4408:

			int metadata, unsigned long *freed)
{
-	struct buffer_head *bitmap_bh = NULL;
+	struct buffer_head *bitmap_bh;
	struct super_block *sb = inode->i_sb;
	struct ext4_allocation_context ac;


						- Ted

  reply	other threads:[~2008-01-26 17:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-26 11:38 Patch for 2.6.25 queue Aneesh Kumar K.V
2008-01-26 17:03 ` Theodore Tso [this message]
2008-01-26 17:14   ` Theodore Tso

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=20080126170331.GB13231@mit.edu \
    --to=tytso@mit.edu \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=theotso@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.