NFS: flag files as supporting FMODE_NOWAIT
Subsystems (2)
PATCH 1/1 NFS: flag files as supporting FMODE_NOWAIT
When opening a file in NFS, set FMODE_NOWAIT in filp->f_mode.
Without this flag, asynchronous I/O frameworks like io_uring assume that the file system does not support non-blocking I/O. This causes io_uring to punt all I/O operations to background io-wq worker threads to avoid blocking the main ring. This results in performance degredation.
By setting FMODE_NOWAIT, we inform the VFS that NFS supports asynchronous I/O natively, keeping execution on the fast path and restoring performance.
Signed-off-by Arik Rinberg <[email protected]>
--- fs/nfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/file.c +1 -1
@@ -73,7 +73,7 @@ nfs_file_open(struct inode *inode, struct file *filp) res =nfs_open (inode, filp);if (res ==0 ) - filp->f_mode |=FMODE_CAN_ODIRECT ; + filp->f_mode |=FMODE_CAN_ODIRECT |FMODE_NOWAIT ;return res; }
Signature · 1 line
2.54.0.rc1.555.g9c883467ad-goog