Skip to contentSkip to conversation

dax: pass NOWAIT flag to iomap_apply

PATCH Applied Jeff Moyer 4 participants 7 messages Feb 5, 2020 – Feb 6, 2020

Subsystems (3)
lore
Share & tools
lore

Jeff Moyer

author
#0 lore raw

PATCH 1/1 dax: pass NOWAIT flag to iomap_apply

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.

fs/dax.c +3 -0
index 1f1f0201cad1..0b0d8819cb1b 100644
@@ -1207,6 +1207,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);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jeff Moyer

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.

Looks good,

Applied
#2 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Jeff Moyer

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.

Quoted 7 lines
Quoted 3 lines

With this patch applied, generic/471 passes for me.

Looks good,

Applied.

reviewer Reviewed-by on v1 1/1
#3 lore raw
In reply to Jeff Moyer
Quoted 8 lines · Jeff Moyer

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.

The patch looks good to me. You can add:

BTW, I've just noticed ext4 seems to be buggy in this regard and even this patch doesn't fix it. So I guess you've been using XFS for testing this?

Honza

Quoted 15 lines
fs/dax.c +3 -0
index 1f1f0201cad1..0b0d8819cb1b 100644
@@ -1207,6 +1207,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);
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#4 lore raw
Quoted 8 lines · Jan Kara
Quoted 7 lines · Jeff Moyer

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.

Quoted 8 lines
Quoted 1 line

The patch looks good to me. You can add:

BTW, I've just noticed ext4 seems to be buggy in this regard and even this patch doesn't fix it. So I guess you've been using XFS for testing this?

That's right, sorry I didn't mention that. Will you send a patch for ext4, or do you want me to look into it?

Thanks!
Jeff

reviewer
#5 lore raw
Quoted 14 lines · Jeff Moyer
Quoted 12 lines · Jan Kara
Quoted 8 lines · Jeff Moyer

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.

The patch looks good to me. You can add:

Quoted 7 lines
Quoted 4 lines

BTW, I've just noticed ext4 seems to be buggy in this regard and even this patch doesn't fix it. So I guess you've been using XFS for testing this?

That's right, sorry I didn't mention that. Will you send a patch for ext4, or do you want me to look into it?

I've taken down a note in todo list to eventually look into that but if you can have a look, I'm more than happy to remove that entry :).

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#6 lore raw
Quoted 17 lines · Jan Kara
Quoted 16 lines · Jeff Moyer
Quoted 14 lines · Jan Kara
Quoted 8 lines · Jeff Moyer

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.

The patch looks good to me. You can add:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

BTW, I've just noticed ext4 seems to be buggy in this regard and even this patch doesn't fix it. So I guess you've been using XFS for testing this?

That's right, sorry I didn't mention that. Will you send a patch for ext4, or do you want me to look into it?

I've taken down a note in todo list to eventually look into that but if you can have a look, I'm more than happy to remove that entry :).

OK, I'll take a look.

-Jeff