diff options
author | Yunlong Song <yunlong.song@huawei.com> | 2017-08-02 22:16:54 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-08-09 17:45:23 -0700 |
commit | 35ee82ca133a58011e648a407d4ab13275c975d4 (patch) | |
tree | 7066db0c77d7d9ec40c576e45fc45d3b369e2999 /fs/f2fs | |
parent | 6415fedc572219e0c8e6b4d3c17c46ed36997ae7 (diff) | |
download | linux-stable-35ee82ca133a58011e648a407d4ab13275c975d4.tar.gz linux-stable-35ee82ca133a58011e648a407d4ab13275c975d4.tar.bz2 linux-stable-35ee82ca133a58011e648a407d4ab13275c975d4.zip |
f2fs: do not change the valid_block value if cur_valid_map was wrongly set or cleared
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/segment.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 7781203a4077..1675a2dcd599 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1538,6 +1538,8 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del) f2fs_msg(sbi->sb, KERN_ERR, "Bitmap was wrongly set, blk:%u", blkaddr); f2fs_bug_on(sbi, 1); + se->valid_blocks--; + del = 0; } if (f2fs_discard_en(sbi) && @@ -1565,6 +1567,8 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del) f2fs_msg(sbi->sb, KERN_ERR, "Bitmap was wrongly cleared, blk:%u", blkaddr); f2fs_bug_on(sbi, 1); + se->valid_blocks++; + del = 0; } if (f2fs_discard_en(sbi) && |