From: Chao Yu <chao@kernel.org>
To: Yunlong Song <yunlong.song@huawei.com>,
jaegeuk@kernel.org, yuchao0@huawei.com, yunlong.song@icloud.com
Cc: miaoxie@huawei.com, bintian.wang@huawei.com,
linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, chao@kernel.org
Subject: Re: [PATCH] f2fs: fix the size value in __check_sit_bitmap
Date: Sat, 5 Aug 2017 13:40:28 +0800 [thread overview]
Message-ID: <0f1a4338-9aa7-5427-6ca2-2102027cf3c4@kernel.org> (raw)
In-Reply-To: <1501837635-128934-1-git-send-email-yunlong.song@huawei.com>
On 2017/8/4 17:07, Yunlong Song wrote:
> The current size value is not correct and will miss bitmap check.
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
> ---
> fs/f2fs/segment.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index f336f8c..45fb534 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -787,11 +787,14 @@ void __check_sit_bitmap(struct f2fs_sb_info *sbi,
> sentry = get_seg_entry(sbi, segno);
> offset = GET_BLKOFF_FROM_SEG0(sbi, blk);
>
> - size = min((unsigned long)(end - blk), max_blocks);
> + if (end < START_BLOCK(sbi, segno + 1))
> + size = GET_BLKOFF_FROM_SEG0(sbi, end);
> + else
> + size = max_blocks;
> map = (unsigned long *)(sentry->cur_valid_map);
> offset = __find_rev_next_bit(map, size, offset);
> f2fs_bug_on(sbi, offset != size);
> - blk += size;
> + blk = START_BLOCK(sbi, segno + 1);
> }
> #endif
> }
>
prev parent reply other threads:[~2017-08-05 5:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 9:07 Yunlong Song
2017-08-05 5:40 ` Chao Yu [this message]
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=0f1a4338-9aa7-5427-6ca2-2102027cf3c4@kernel.org \
--to=chao@kernel.org \
--cc=bintian.wang@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=yuchao0@huawei.com \
--cc=yunlong.song@huawei.com \
--cc=yunlong.song@icloud.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®