summaryrefslogtreecommitdiff
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-10-04 09:08:37 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-10-26 10:44:10 +0200
commitcf5c759f927dc92452fa214691be0c8a3e7c115d (patch)
tree25ca30602ff0b3037bf5a91c71826af1423250ca /fs/f2fs/super.c
parent2ec6f2ef799b94e6e99868ef586cafceaa7c0475 (diff)
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>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index f98a07c859e9..3a47b3271d0d 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -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,
};