[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1203120830480.5543@dhcp-27-109.brq.redhat.com>
Date: Mon, 12 Mar 2012 08:31:43 +0100 (CET)
From: Lukas Czerner <lczerner@...hat.com>
To: "Theodore Ts'o" <tytso@....edu>
cc: Ext4 Developers List <linux-ext4@...r.kernel.org>,
lczerner@...hat.com
Subject: Re: [PATCH 2/3] e2fsck: do not forget to discard last block group
On Sun, 11 Mar 2012, Theodore Ts'o wrote:
> From: Lukas Czerner <lczerner@...hat.com>
>
> Previously when running e2fsck with '-E discard' argument the end of
> the last group has not been discarded. This patch fixes it so we
> always discard the end of the last group if needed.
>
> Signed-off-by: Lukas Czerner <lczerner@...hat.com>
> Signed-off-by: Theodore Ts'o <tytso@....edu>
Looks good. Thanks for splitting the patch, it makes sense.
-Lukas
> ---
> e2fsck/pass5.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c
> index ca438cb..e25f080 100644
> --- a/e2fsck/pass5.c
> +++ b/e2fsck/pass5.c
> @@ -387,6 +387,15 @@ redo_counts:
> if ((blocks == fs->super->s_clusters_per_group) ||
> (EXT2FS_B2C(fs, i) ==
> EXT2FS_B2C(fs, ext2fs_blocks_count(fs->super)-1))) {
> + /*
> + * If the last block of this group is free, then we can
> + * discard it as well.
> + */
> + if (!bitmap && i >= first_free)
> + e2fsck_discard_blocks(ctx, first_free,
> + (i - first_free) + 1);
> + first_free = ext2fs_blocks_count(fs->super);
> +
> free_array[group] = group_free;
> group ++;
> blocks = 0;
>
--
--
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