All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: skip iunlock with empty iolock flags in xfs_file_dio_write_aligned
@ 2026-10-21 21:00 Anthony Iliopoulos
  2026-10-22  7:42 ` Pankaj Raghav (Samsung)
  2026-10-27 15:43 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Anthony Iliopoulos @ 2026-10-21 21:00 UTC (permalink / raw)
  To: linux-xfs

When using RWF_NOWAIT, xfs_file_write_checks may fail to acquire an
exclusive lock upgrade and return -EAGAIN for aligned DIO, setting
iolock to 0.

In XFS_DEBUG kernels, passing no lock flags to xfs_iunlock triggers an
assertion failure. Fix this by unlocking the iolock only when there are
any flags set.

Fixes: 2e2383405824 ("xfs: implement direct writes to zoned RT devices")
Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
 fs/xfs/xfs_file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 7d0c8a197575..1eab6dbb4c5f 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -766,7 +766,8 @@ xfs_file_dio_write_aligned(
 	trace_xfs_file_direct_write(iocb, from);
 	ret = iomap_dio_rw(iocb, from, ops, dops, dio_flags, ac, 0);
 out_unlock:
-	xfs_iunlock(ip, iolock);
+	if (iolock)
+		xfs_iunlock(ip, iolock);
 	return ret;
 }
 
-- 
2.56.0


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

end of thread, other threads:[~2026-10-27 15:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 21:00 [PATCH] xfs: skip iunlock with empty iolock flags in xfs_file_dio_write_aligned Anthony Iliopoulos
2026-10-22  7:42 ` Pankaj Raghav (Samsung)
2026-10-27 15:43 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.