summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2020-02-05 14:15:58 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-11 18:02:43 +0100
commitde020833f8f4bd95a4e73ef59a7b01ce3c78447b (patch)
treee2198b77b9d5924685ce5ddee5a2e9bacaf5c40e /fs
parent313810964cacf555c88c77b47f837d5cf232992b (diff)
dax: pass NOWAIT flag to iomap_apply
[ Upstream commit 96222d53842dfe54869ec4e1b9d4856daf9105a2 ] 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 <jmoyer@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/x49r1z86e1d.fsf@segfault.boston.devel.redhat.com Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/dax.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/dax.c b/fs/dax.c
index ddb4981ae32e..34a55754164f 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1057,6 +1057,9 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
lockdep_assert_held(&inode->i_rwsem);
}
+ 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);