]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: allow parallel DIO reads
authorJaegeuk Kim <jaegeuk@kernel.org>
Wed, 9 Oct 2024 19:40:07 +0000 (19:40 +0000)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 11 Oct 2024 15:12:07 +0000 (15:12 +0000)
This fixes a regression which prevents parallel DIO reads.

Fixes: 0cac51185e65 ("f2fs: fix to avoid racing in between read and OPU dio write")
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 9ae54c4c72fe92323ff7c8a84182968a5faa5673..321d8ffbab6e4bd6cd202d5d34a8ad87b7ac3137 100644 (file)
@@ -4647,7 +4647,8 @@ static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
                                        iov_iter_count(to), READ);
 
        /* In LFS mode, if there is inflight dio, wait for its completion */
-       if (f2fs_lfs_mode(F2FS_I_SB(inode)))
+       if (f2fs_lfs_mode(F2FS_I_SB(inode)) &&
+           get_pages(F2FS_I_SB(inode), F2FS_DIO_WRITE))
                inode_dio_wait(inode);
 
        if (f2fs_should_use_dio(inode, iocb, to)) {