]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
f2fs: pin files do not require sbi->writepages lock for ordering
authorYongpeng Yang <yangyongpeng@xiaomi.com>
Thu, 15 Jan 2026 16:47:50 +0000 (00:47 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 27 Jan 2026 02:45:58 +0000 (02:45 +0000)
For pinned files, the file mapping is already established before
writing, and since the writes are in IPU, there is no need to acquire
the sbi->writepages lock to guarantee write ordering.

Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 9ef875e7b34c19642cc661cac8aacd7f52165c99..84746a06cd5824ced351bc3bad35e155b329fb30 100644 (file)
@@ -3477,6 +3477,8 @@ static inline bool __should_serialize_io(struct inode *inode,
        if (IS_NOQUOTA(inode))
                return false;
 
+       if (f2fs_is_pinned_file(inode))
+               return false;
        if (f2fs_need_compress_data(inode))
                return true;
        if (wbc->sync_mode != WB_SYNC_ALL)