]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:51:48 +0000 (08:51 +0100)
[ Upstream commit a8075dc484cf10ebdb07bee2b17322fb0a846309 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/segment.c

index a807a8d5e38f06178c78f4ff3c31513bdb6b62b4..0e3e590a250f7cf58e2c02a5ee1a2a9cd5caf57c 100644 (file)
@@ -637,7 +637,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;
        }