From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com
Cc: miaoxie@huawei.com, tony.zhangxiaobo@huawei.com,
linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] f2fs: check total CP pack block count correctly
Date: Wed, 1 Aug 2018 11:46:22 +0800 [thread overview]
Message-ID: <20180801034622.162122-1-shengyong1@huawei.com> (raw)
Fixes: 652d19558a347 ('f2fs: fix to do sanity check with block address in main area')
Reported-by: Zhang Xiaobo <tony.zhangxiaobo@huawei.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
fs/f2fs/checkpoint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 3587aa53dc90..c32ee10a1384 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -809,7 +809,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
goto invalid_cp1;
if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
- sbi->log_blocks_per_seg) {
+ sbi->blocks_per_seg - 1) {
f2fs_msg(sbi->sb, KERN_WARNING,
"invalid cp_pack_total_block_count:%u",
le32_to_cpu(cp_block->cp_pack_total_block_count));
--
2.17.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next reply other threads:[~2018-08-01 3:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-01 3:46 Sheng Yong [this message]
2018-08-01 6:56 ` [PATCH] f2fs: check total CP pack block count correctly Chao Yu
2018-08-01 7:36 ` Sheng Yong
2018-08-01 10:26 ` Chao Yu
2018-08-01 10:58 ` Sheng Yong
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=20180801034622.162122-1-shengyong1@huawei.com \
--to=shengyong1@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=miaoxie@huawei.com \
--cc=tony.zhangxiaobo@huawei.com \
--cc=yuchao0@huawei.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;
as well as URLs for NNTP newsgroup(s).