[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 7 Jul 2008 12:46:07 -0400
From: Theodore Tso <tytso@....EDU>
To: Celine Bourde <celine.bourde@...l.net>
Cc: linux-ext4@...r.kernel.org, "Jose R. Santos" <jrs@...ibm.com>,
cmm@...ibm.com,
Frédéric Bohé <frederic.bohe@...l.net>,
SOLOFO RAMANGALAHY <Solofo.Ramangalahy@...l.net>,
Jean-Pierre Dion <jean-pierre.dion@...l.net>
Subject: Re: [PATCH][e2fsprogs][mke2fs] fix FLEX_BG offset
On Thu, Jul 03, 2008 at 10:21:02AM +0200, Celine Bourde wrote:
> This patch resolves the offset problem of the flex_bg
> option when you use mke2fs tool.
Actually, I think the problem is a bigger one. Ext2fs_get_free_blocks()
returns a error code on failure. So the code before the conditional
you modified is totally bogus:
/* Find the first available block */
if (ext2fs_get_free_blocks(fs, start_blk, last_blk, 1, bmap,
&first_free))
return first_free;
if (ext2fs_get_free_blocks(fs, first_free + offset, last_blk, size,
bmap, &first_free))
return first_free;
return first_free;
I think this should be instead:
/* Find the first available block */
if (ext2fs_get_free_blocks(fs, start_blk, last_blk, 1, bmap,
&first_free) == 0)
return first_free;
if (ext2fs_get_free_blocks(fs, first_free + offset, last_blk, size,
bmap, &first_free) == 0)
return first_free;
/*
* Oops, we weren't able to find enough space. We return
* first_free as a best try.
*/
return first_free;
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists