diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 326e6342c578..bb66faf09eea 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2962,15 +2962,17 @@ static int f2fs_write_cache_pages(struct address_space *mapping, static inline bool __should_serialize_io(struct inode *inode, struct writeback_control *wbc) { - if (!S_ISREG(inode->i_mode)) - return false; - if (f2fs_compressed_file(inode)) - return true; - if (IS_NOQUOTA(inode)) - return false; /* to avoid deadlock in path of data flush */ if (F2FS_I(inode)->cp_task) return false; + + if (!S_ISREG(inode->i_mode)) + return false; + if (IS_NOQUOTA(inode)) + return false; + + if (f2fs_compressed_file(inode)) + return true; if (wbc->sync_mode != WB_SYNC_ALL) return true; if (get_dirty_pages(inode) >= SM_I(F2FS_I_SB(inode))->min_seq_blocks)