[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190730161019.GH28829@quack2.suse.cz>
Date: Tue, 30 Jul 2019 18:10:19 +0200
From: Jan Kara <jack@...e.cz>
To: Chengguang Xu <cgxu519@...o.com.cn>
Cc: Jan Kara <jack@...e.com>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 2/2] ext2: code cleanup for ext2_free_blocks()
On Tue 23-07-19 19:21:55, Chengguang Xu wrote:
> Call ext2_data_block_valid() for block range validity.
>
> Signed-off-by: Chengguang Xu <cgxu519@...o.com.cn>
Thanks for both patches. I've added them to my tree.
Honza
> ---
> fs/ext2/balloc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
> index 92e9a7489174..e0cc55164505 100644
> --- a/fs/ext2/balloc.c
> +++ b/fs/ext2/balloc.c
> @@ -490,9 +490,7 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
> struct ext2_super_block * es = sbi->s_es;
> unsigned freed = 0, group_freed;
>
> - if (block < le32_to_cpu(es->s_first_data_block) ||
> - block + count < block ||
> - block + count > le32_to_cpu(es->s_blocks_count)) {
> + if (!ext2_data_block_valid(sbi, block, count)) {
> ext2_error (sb, "ext2_free_blocks",
> "Freeing blocks not in datazone - "
> "block = %lu, count = %lu", block, count);
> --
> 2.20.1
>
>
>
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists