aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-06-05 17:44:11 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-07-27 18:03:59 +0900
commite1da7872f6eda977bd812346bf588c35e4495a1e (patch)
tree1aef775092817c292fb379aa7ece851473589c07 /fs/f2fs/segment.c
parentf2fs: use timespec64 for inode timestamps (diff)
downloadwireguard-linux-e1da7872f6eda977bd812346bf588c35e4495a1e.tar.xz
wireguard-linux-e1da7872f6eda977bd812346bf588c35e4495a1e.zip
f2fs: introduce and spread verify_blkaddr
This patch introduces verify_blkaddr to check meta/data block address with valid range to detect bug earlier. In addition, once we encounter an invalid blkaddr, notice user to run fsck to fix, and let the kernel panic. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 6dc8828b4d87..654091ec9cfe 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1919,7 +1919,7 @@ bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr)
struct seg_entry *se;
bool is_cp = false;
- if (!is_valid_blkaddr(blkaddr))
+ if (!is_valid_data_blkaddr(sbi, blkaddr))
return true;
down_read(&sit_i->sentry_lock);
@@ -2993,7 +2993,7 @@ void f2fs_wait_on_block_writeback(struct f2fs_sb_info *sbi, block_t blkaddr)
{
struct page *cpage;
- if (!is_valid_blkaddr(blkaddr))
+ if (!is_valid_data_blkaddr(sbi, blkaddr))
return;
cpage = find_lock_page(META_MAPPING(sbi), blkaddr);