Skip to contentSkip to conversation

f2fs: allow parallel DIO reads

PATCH Applied Jaegeuk Kim 3 participants 3 messages Oct 10, 2024 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: allow parallel DIO reads

This fixes a regression which prevents parallel DIO reads.

Fixes 0cac51185e65 ("f2fs: fix to avoid racing in between read and OPU dio write")
---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/file.c +2 -1
index 71d5ded9eeda..adc7d64a6f47 100644
@@ -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)) {
Signature · 1 line
2.47.0.rc1.288.g06298d1525-goog
Reviewed-by on v1 1/1
#1 lore raw

Thanks,

Quoted 32 lines · On Wed, Oct 9, 2024 at 5:10 PM Jaegeuk Kim via Linux-f2fs-devel…

This fixes a regression which prevents parallel DIO reads.

Fixes 0cac51185e65 ("f2fs: fix to avoid racing in between read and OPU dio write")
---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/file.c +2 -2
index 71d5ded9eeda..adc7d64a6f47 100644
@@ -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)) {
--

2.47.0.rc1.288.g06298d1525-goog

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw
In reply to Jaegeuk Kim
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 7 lines · On Thu, 10 Oct 2024 00:09:23 +0000 you wrote:

This fixes a regression which prevents parallel DIO reads.

Fixes 0cac51185e65 ("f2fs: fix to avoid racing in between read and OPU dio write")
---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
- [f2fs-dev] f2fs: allow parallel DIO reads

    https://git.kernel.org/jaegeuk/f2fs/c/bdab38b79199

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html