blob: 6e8636217e966ca7ff316688d3d92eb3504c7a7e [file] [log] [blame]
From a12f677f5a36761fc3f6df8fbbdab16b6deeaa49 Mon Sep 17 00:00:00 2001
From: Jeff Moyer <>
Date: Wed, 5 Feb 2020 14:15:58 -0500
Subject: [PATCH] dax: pass NOWAIT flag to iomap_apply
commit 96222d53842dfe54869ec4e1b9d4856daf9105a2 upstream.
fstests generic/471 reports a failure when run with MOUNT_OPTIONS="-o
dax". The reason is that the initial pwrite to an empty file with the
RWF_NOWAIT flag set does not return -EAGAIN. It turns out that
dax_iomap_rw doesn't pass that flag through to iomap_apply.
With this patch applied, generic/471 passes for me.
Signed-off-by: Jeff Moyer <>
Reviewed-by: Christoph Hellwig <>
Reviewed-by: Jan Kara <>
Signed-off-by: Dan Williams <>
Signed-off-by: Paul Gortmaker <>
diff --git a/fs/dax.c b/fs/dax.c
index 36538f5ecc31..aaa16945ef8a 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1208,6 +1208,9 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
+ if (iocb->ki_flags & IOCB_NOWAIT)
+ flags |= IOMAP_NOWAIT;
while (iov_iter_count(iter)) {
ret = iomap_apply(inode, pos, iov_iter_count(iter), flags, ops,
iter, dax_iomap_actor);