f2fs: give up CP_TRIMMED_FLAG if it drops discards
In ->umount, once we drop remained discard entries, we should not set CP_TRIMMED_FLAG with another checkpoint. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -781,6 +781,7 @@ static void f2fs_put_super(struct super_block *sb)
|
||||
{
|
||||
struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
||||
int i;
|
||||
bool dropped;
|
||||
|
||||
f2fs_quota_off_umount(sb);
|
||||
|
||||
@@ -801,9 +802,9 @@ static void f2fs_put_super(struct super_block *sb)
|
||||
}
|
||||
|
||||
/* be sure to wait for any on-going discard commands */
|
||||
f2fs_wait_discard_bios(sbi);
|
||||
dropped = f2fs_wait_discard_bios(sbi);
|
||||
|
||||
if (f2fs_discard_en(sbi) && !sbi->discard_blks) {
|
||||
if (f2fs_discard_en(sbi) && !sbi->discard_blks && !dropped) {
|
||||
struct cp_control cpc = {
|
||||
.reason = CP_UMOUNT | CP_TRIMMED,
|
||||
};
|
||||
|
Reference in New Issue
Block a user