diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 801b0b0b08f4..e4081fc91012 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1275,6 +1275,10 @@ static int f2fs_write_data_pages(struct address_space *mapping, if (!mapping->a_ops->writepage) return 0; + /* skip writing if there is no dirty page in this inode */ + if (!get_dirty_pages(inode) && wbc->sync_mode == WB_SYNC_NONE) + return 0; + if (S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_NONE && get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) && available_free_memory(sbi, DIRTY_DENTS))