Skip to contentSkip to conversation

f2fs: zone: wait for inflight dio completion, excluding pinned files

PATCH Superseded yohan.joung 2 participants 3 messages Jul 21, 2025 – Jul 22, 2025 F2FS file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: zone: wait for inflight dio completion, excluding pinned files

pinfile is excluded as it operates with direct I/O

---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/file.c +2 -1
index 4039ccb5022c..cac8c9650a7a 100644
@@ -4844,7 +4844,8 @@ static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
 
 	/* In LFS mode, if there is inflight dio, wait for its completion */
 	if (f2fs_lfs_mode(F2FS_I_SB(inode)) &&
-	    get_pages(F2FS_I_SB(inode), F2FS_DIO_WRITE))
+	    get_pages(F2FS_I_SB(inode), F2FS_DIO_WRITE) &&
+		!f2fs_is_pinned_file(inode))
 		inode_dio_wait(inode);
 
 	if (f2fs_should_use_dio(inode, iocb, to)) {
Signature · 8 lines
2.33.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer
#1 lore raw
Quoted 1 line · yohan.joung

pinfile is excluded as it operates with direct I/O

pinfile can use buffer IO as well?

Thanks,

Quoted 20 lines
---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/file.c +2 -1
index 4039ccb5022c..cac8c9650a7a 100644
@@ -4844,7 +4844,8 @@ static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
 
 	/* In LFS mode, if there is inflight dio, wait for its completion */
 	if (f2fs_lfs_mode(F2FS_I_SB(inode)) &&
-	    get_pages(F2FS_I_SB(inode), F2FS_DIO_WRITE))
+	    get_pages(F2FS_I_SB(inode), F2FS_DIO_WRITE) &&
+		!f2fs_is_pinned_file(inode))
 		inode_dio_wait(inode);
 
 	if (f2fs_should_use_dio(inode, iocb, to)) {
#2 lore raw
Quoted 4 lines · yohan.joung
Quoted 1 line

pinfile is excluded as it operates with direct I/O

pinfile can use buffer IO as well?

only considered direct I/O. I'll re-upload the pinfile considering buffered I/O Thanks

Quoted 22 lines

Thanks,

Quoted 19 lines
---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/file.c +2 -1
index 4039ccb5022c..cac8c9650a7a 100644
@@ -4844,7 +4844,8 @@ static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
 
 	/* In LFS mode, if there is inflight dio, wait for its completion */
 	if (f2fs_lfs_mode(F2FS_I_SB(inode)) &&
-	    get_pages(F2FS_I_SB(inode), F2FS_DIO_WRITE))
+	    get_pages(F2FS_I_SB(inode), F2FS_DIO_WRITE) &&
+		!f2fs_is_pinned_file(inode))
 		inode_dio_wait(inode);