From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Andreas Dilger <adilger@sun.com>
Cc: cmm@us.ibm.com, akpm@linux-foundation.org,
linux-ext4@vger.kernel.org, Mingming Cao <cmm@us.vnet.ibm.com>
Subject: Re: [PATCH] ext3: Return EIO if new block is allocated from system zone.
Date: Tue, 25 Mar 2008 16:33:11 +0530 [thread overview]
Message-ID: <20080325110311.GA7151@skywalker> (raw)
In-Reply-To: <20080324223251.GL2691@webber.adilger.int>
On Mon, Mar 24, 2008 at 04:32:51PM -0600, Andreas Dilger wrote:
> On Mar 24, 2008 22:34 +0530, Aneesh Kumar K.V wrote:
> > If the block allocator gets blocks out of system zone ext3 calls
> > ext3_error. But if the file system is mounted with errors=continue
> > return with -EIO.
> >
> > System zone is the block range mapping block bitmap, inode bitmap and inode
> > table.
>
> I don't understand this patch. Surely it has nothing to do with the user,
> and instead the code should re-try the allocation after marking the block
> in-use in the bitmap?
>
> > Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> > Signed-off-by: Mingming Cao <cmm@us.vnet.ibm.com>
> > ---
> > fs/ext3/balloc.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
> > index da0cb2c..6ce7f7d 100644
> > --- a/fs/ext3/balloc.c
> > +++ b/fs/ext3/balloc.c
> > @@ -1642,7 +1642,7 @@ allocated:
> > "Allocating block in system zone - "
> > "blocks from "E3FSBLK", length %lu",
> > ret_block, num);
> > - goto out;
> > + goto io_error;
> > }
>
> I think the problem here is that this "goto" is simply an in-effective
> method of error handling. The block HAS to be marked in-use in the
> bitmap, or it will just continue to try and be allocated. After marking
> the block in-use there should be a "goto retry-alloc" instead of error.
> To be honest, I thought in 2.6 this would invoke the block bitmap checking
> code to revalidate the whole bitmap at this point and then retry the alloc.
>
> In 2.4 this similar code looks like:
>
> if (tmp == le32_to_cpu(gdp->bg_block_bitmap) ||
> tmp == le32_to_cpu(gdp->bg_inode_bitmap) ||
> in_range (tmp, le32_to_cpu(gdp->bg_inode_table),
> EXT3_SB(sb)->s_itb_per_group)) {
> ext3_error(sb, __FUNCTION__,
> "Allocating block in system zone - block = %u", tmp);
>
> /* Note: This will potentially use up one of the handle's
> * buffer credits. Normally we have way too many credits,
> * so that is OK. In _very_ rare cases it might not be OK.
> * We will trigger an assertion if we run out of credits,
> * and we will have to do a full fsck of the filesystem -
> * better than randomly corrupting filesystem metadata.
> */
> ext3_set_bit(j, bh->b_data);
> goto repeat;
> }
>
>
How about this. Patch is not complete, we leak some of the blocks here.
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 6d30af2..a9f27c7 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -289,11 +289,11 @@ read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
(int)block_group, (unsigned long long)bitmap_blk);
return NULL;
}
- if (!ext4_valid_block_bitmap(sb, desc, block_group, bh)) {
- put_bh(bh);
- return NULL;
- }
next prev parent reply other threads:[~2008-03-25 11:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-24 17:04 [PATCH] ext3: Return EIO if new block is allocated from system zone Aneesh Kumar K.V
2008-03-24 17:04 ` [PATCH] ext3: Use page_mkwrite vma_operations to get mmap write notification Aneesh Kumar K.V
2008-03-24 17:04 ` [PATCH] ext4: Export needed symbol for ZERO_PAGE usage in modules Aneesh Kumar K.V
2008-03-24 17:04 ` [PATCH] ext2: Use page_mkwrite vma_operations to get mmap write notification Aneesh Kumar K.V
2008-03-24 23:01 ` [PATCH] ext3: " Andrew Morton
2008-03-25 9:21 ` Nick Piggin
2008-03-24 22:32 ` [PATCH] ext3: Return EIO if new block is allocated from system zone Andreas Dilger
2008-03-25 11:03 ` Aneesh Kumar K.V [this message]
2008-03-25 20:59 ` Andreas Dilger
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=20080325110311.GA7151@skywalker \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=cmm@us.ibm.com \
--cc=cmm@us.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
/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