f2fs: fix to account preflush command for noflush_merge mode
authorChao Yu <yuchao0@huawei.com>
Wed, 24 Oct 2018 09:24:10 +0000 (17:24 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 26 Nov 2018 23:53:55 +0000 (15:53 -0800)
Previously, we only account preflush command for flush_merge mode,
so for noflush_merge mode, we can not know in-flight preflush
command count, fix it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 6edcf83..d161f5a 100644 (file)
@@ -620,7 +620,9 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi, nid_t ino)
                return 0;
 
        if (!test_opt(sbi, FLUSH_MERGE)) {
+               atomic_inc(&fcc->issing_flush);
                ret = submit_flush_wait(sbi, ino);
+               atomic_dec(&fcc->issing_flush);
                atomic_inc(&fcc->issued_flush);
                return ret;
        }