Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: fix to set sbi dirty correctly

In order to record direct IO count, we add two additional type in
enum count_type: F2FS_DIO_{WRITE,READ}, but those IO won't dirty
filesystem metadata, so we don't need to set filesystem dirty in
inc_page_count(), fix it.

Fixes: 02b16d0a34a1 ("f2fs: add to account direct IO")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
20109873 f9aa52a8

+6 -7
+6 -7
fs/f2fs/f2fs.h
··· 1799 1799 { 1800 1800 atomic_inc(&sbi->nr_pages[count_type]); 1801 1801 1802 - if (count_type == F2FS_DIRTY_DATA || count_type == F2FS_INMEM_PAGES || 1803 - count_type == F2FS_WB_CP_DATA || count_type == F2FS_WB_DATA || 1804 - count_type == F2FS_RD_DATA || count_type == F2FS_RD_NODE || 1805 - count_type == F2FS_RD_META) 1806 - return; 1807 - 1808 - set_sbi_flag(sbi, SBI_IS_DIRTY); 1802 + if (count_type == F2FS_DIRTY_DENTS || 1803 + count_type == F2FS_DIRTY_NODES || 1804 + count_type == F2FS_DIRTY_META || 1805 + count_type == F2FS_DIRTY_QDATA || 1806 + count_type == F2FS_DIRTY_IMETA) 1807 + set_sbi_flag(sbi, SBI_IS_DIRTY); 1809 1808 } 1810 1809 1811 1810 static inline void inode_inc_dirty_pages(struct inode *inode)