* [patch] dax: pass NOWAIT flag to iomap_apply
@ 2020-02-05 19:15 Jeff Moyer
2020-02-05 19:28 ` Christoph Hellwig
2020-02-06 8:47 ` Jan Kara
0 siblings, 2 replies; 7+ messages in thread
From: Jeff Moyer @ 2020-02-05 19:15 UTC (permalink / raw)
To: dan.j.williams; +Cc: linux-fsdevel, linux-nvdimm, willy, jack
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>
diff --git a/fs/dax.c b/fs/dax.c
index 1f1f0201cad1..0b0d8819cb1b 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -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);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [patch] dax: pass NOWAIT flag to iomap_apply
2020-02-05 19:15 [patch] dax: pass NOWAIT flag to iomap_apply Jeff Moyer
@ 2020-02-05 19:28 ` Christoph Hellwig
2020-02-06 4:52 ` Dan Williams
2020-02-06 8:47 ` Jan Kara
1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2020-02-05 19:28 UTC (permalink / raw)
To: Jeff Moyer; +Cc: dan.j.williams, linux-fsdevel, linux-nvdimm, willy, jack
On Wed, Feb 05, 2020 at 02:15:58PM -0500, Jeff Moyer wrote:
> 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>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] dax: pass NOWAIT flag to iomap_apply
2020-02-05 19:28 ` Christoph Hellwig
@ 2020-02-06 4:52 ` Dan Williams
0 siblings, 0 replies; 7+ messages in thread
From: Dan Williams @ 2020-02-06 4:52 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jeff Moyer, linux-fsdevel, linux-nvdimm, Matthew Wilcox, Jan Kara
On Wed, Feb 5, 2020 at 11:28 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Wed, Feb 05, 2020 at 02:15:58PM -0500, Jeff Moyer wrote:
> > 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>
>
> Looks good,
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
Applied.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] dax: pass NOWAIT flag to iomap_apply
2020-02-05 19:15 [patch] dax: pass NOWAIT flag to iomap_apply Jeff Moyer
2020-02-05 19:28 ` Christoph Hellwig
@ 2020-02-06 8:47 ` Jan Kara
2020-02-06 14:33 ` Jeff Moyer
1 sibling, 1 reply; 7+ messages in thread
From: Jan Kara @ 2020-02-06 8:47 UTC (permalink / raw)
To: Jeff Moyer; +Cc: dan.j.williams, linux-fsdevel, linux-nvdimm, willy, jack
On Wed 05-02-20 14:15:58, Jeff Moyer wrote:
> 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>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
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
> diff --git a/fs/dax.c b/fs/dax.c
> index 1f1f0201cad1..0b0d8819cb1b 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -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);
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] dax: pass NOWAIT flag to iomap_apply
2020-02-06 8:47 ` Jan Kara
@ 2020-02-06 14:33 ` Jeff Moyer
2020-02-06 14:43 ` Jan Kara
0 siblings, 1 reply; 7+ messages in thread
From: Jeff Moyer @ 2020-02-06 14:33 UTC (permalink / raw)
To: Jan Kara; +Cc: dan.j.williams, linux-fsdevel, linux-nvdimm, willy
Jan Kara <jack@suse.cz> writes:
> On Wed 05-02-20 14:15:58, Jeff Moyer wrote:
>> 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>
>
> The patch looks good to me. You can add:
>
> Reviewed-by: Jan Kara <jack@suse.cz>
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] dax: pass NOWAIT flag to iomap_apply
2020-02-06 14:33 ` Jeff Moyer
@ 2020-02-06 14:43 ` Jan Kara
2020-02-06 15:39 ` Jeff Moyer
0 siblings, 1 reply; 7+ messages in thread
From: Jan Kara @ 2020-02-06 14:43 UTC (permalink / raw)
To: Jeff Moyer; +Cc: Jan Kara, dan.j.williams, linux-fsdevel, linux-nvdimm, willy
On Thu 06-02-20 09:33:39, Jeff Moyer wrote:
> Jan Kara <jack@suse.cz> writes:
>
> > On Wed 05-02-20 14:15:58, Jeff Moyer wrote:
> >> 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>
> >
> > The patch looks good to me. You can add:
> >
> > Reviewed-by: Jan Kara <jack@suse.cz>
> >
> > 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
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] dax: pass NOWAIT flag to iomap_apply
2020-02-06 14:43 ` Jan Kara
@ 2020-02-06 15:39 ` Jeff Moyer
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Moyer @ 2020-02-06 15:39 UTC (permalink / raw)
To: Jan Kara; +Cc: dan.j.williams, linux-fsdevel, linux-nvdimm, willy
Jan Kara <jack@suse.cz> writes:
> On Thu 06-02-20 09:33:39, Jeff Moyer wrote:
>> Jan Kara <jack@suse.cz> writes:
>>
>> > On Wed 05-02-20 14:15:58, Jeff Moyer wrote:
>> >> 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>
>> >
>> > The patch looks good to me. You can add:
>> >
>> > Reviewed-by: Jan Kara <jack@suse.cz>
>> >
>> > 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-02-06 15:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 19:15 [patch] dax: pass NOWAIT flag to iomap_apply Jeff Moyer
2020-02-05 19:28 ` Christoph Hellwig
2020-02-06 4:52 ` Dan Williams
2020-02-06 8:47 ` Jan Kara
2020-02-06 14:33 ` Jeff Moyer
2020-02-06 14:43 ` Jan Kara
2020-02-06 15:39 ` Jeff Moyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).