Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] xfs: Call kiocb_modified() for buffered write
@ 2022-11-16 14:42 Xiao Yang
  2022-11-16 19:00 ` Stefan Roesch
  0 siblings, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2022-11-16 14:42 UTC (permalink / raw)
  To: shr, djwong; +Cc: linux-xfs, ruansy.fnst, Xiao Yang

kiocb_modified() should be used for sync/async buffered write
because it will return -EAGAIN when IOCB_NOWAIT is set. Unfortunately,
kiocb_modified() is used by the common xfs_file_write_checks()
which is called by all types of write(i.e. buffered/direct/dax write).
This issue makes generic/471 with xfs always get the following error:
--------------------------------------------------------
QA output created by 471
pwrite: Resource temporarily unavailable
wrote 8388608/8388608 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
pwrite: Resource temporarily unavailable
...
--------------------------------------------------------

Fixes: 1aa91d9c9933 ("xfs: Add async buffered write support")
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 fs/xfs/xfs_file.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index e462d39c840e..561fab3a49c7 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -417,6 +417,9 @@ xfs_file_write_checks(
 		spin_unlock(&ip->i_flags_lock);
 
 out:
+	if (IS_DAX(inode) || (iocb->ki_flags & IOCB_DIRECT))
+		return file_modified(file);
+
 	return kiocb_modified(iocb);
 }
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-13 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-16 14:42 [PATCH] xfs: Call kiocb_modified() for buffered write Xiao Yang
2022-11-16 19:00 ` Stefan Roesch
2022-11-17  2:28   ` Yang, Xiao/杨 晓
2023-01-13  4:55     ` yangx.jy
2023-01-13 18:02       ` Stefan Roesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox