2018-06-27 21:22:51

by Ross Zwisler

[permalink] [raw]
Subject: [PATCH v2 1/2] dax: dax_layout_busy_page() warn on !exceptional

Inodes using DAX should only ever have exceptional entries in their page
caches. Make this clear by warning if the iteration in
dax_layout_busy_page() ever sees a non-exceptional entry, and by adding a
comment for the pagevec_release() call which only deals with struct page
pointers.

Signed-off-by: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/[email protected]>
Reviewed-by: Jan Kara <[email protected]>
---
fs/dax.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/dax.c b/fs/dax.c
index 641192808bb6..897b51e41d8f 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -566,7 +566,8 @@ struct page *dax_layout_busy_page(struct address_space *mapping)
if (index >= end)
break;

- if (!radix_tree_exceptional_entry(pvec_ent))
+ if (WARN_ON_ONCE(
+ !radix_tree_exceptional_entry(pvec_ent)))
continue;

xa_lock_irq(&mapping->i_pages);
@@ -578,6 +579,13 @@ struct page *dax_layout_busy_page(struct address_space *mapping)
if (page)
break;
}
+
+ /*
+ * We don't expect normal struct page entries to exist in our
+ * tree, but we keep these pagevec calls so that this code is
+ * consistent with the common pattern for handling pagevecs
+ * throughout the kernel.
+ */
pagevec_remove_exceptionals(&pvec);
pagevec_release(&pvec);
index++;
--
2.14.4


2018-07-02 22:15:03

by Theodore Y. Ts'o

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dax: dax_layout_busy_page() warn on !exceptional

On Wed, Jun 27, 2018 at 03:22:51PM -0600, Ross Zwisler wrote:
> Inodes using DAX should only ever have exceptional entries in their page
> caches. Make this clear by warning if the iteration in
> dax_layout_busy_page() ever sees a non-exceptional entry, and by adding a
> comment for the pagevec_release() call which only deals with struct page
> pointers.
>
> Signed-off-by: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/[email protected]>
> Reviewed-by: Jan Kara <[email protected]>

Thanks, applied (to the ext4 tree). If someone thinks they should go
in via some other tree, holler.

- Ted

2018-07-03 15:41:37

by Ross Zwisler

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dax: dax_layout_busy_page() warn on !exceptional

On Mon, Jul 02, 2018 at 06:15:03PM -0400, Theodore Y. Ts'o wrote:
> On Wed, Jun 27, 2018 at 03:22:51PM -0600, Ross Zwisler wrote:
> > Inodes using DAX should only ever have exceptional entries in their page
> > caches. Make this clear by warning if the iteration in
> > dax_layout_busy_page() ever sees a non-exceptional entry, and by adding a
> > comment for the pagevec_release() call which only deals with struct page
> > pointers.
> >
> > Signed-off-by: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/[email protected]>
> > Reviewed-by: Jan Kara <[email protected]>
>
> Thanks, applied (to the ext4 tree). If someone thinks they should go
> in via some other tree, holler.
>
> - Ted

Hey Ted,

It looks like you only picked up patch 1/2? (I'm looking at the 'dev' branch
in your repo.) Was that intentional?

You can find the final version of the 2nd patch here:

https://lists.01.org/pipermail/linux-nvdimm/2018-July/016602.html

Thanks,
- Ross

2018-07-03 17:44:02

by Theodore Y. Ts'o

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dax: dax_layout_busy_page() warn on !exceptional

On Tue, Jul 03, 2018 at 09:41:37AM -0600, Ross Zwisler wrote:
>
> It looks like you only picked up patch 1/2? (I'm looking at the 'dev' branch
> in your repo.) Was that intentional?

Actually, it was a mistake, in that if you looked at the commit, it's
currently an empty commit. The patch failed to apply because the ext4
tree is still based on v4.17-rc4.

My current plan is to hold the two patches until I get the current
patch of fixes pushed to Linus (probably in the next day or two; I'll
drop the empty commit before I send a pull request to reduce
confusion). I'll then reset the ext4 tree to be based on v4.17 (or
possibly v4.18-rcX if that is necessary) and then apply the two
patches in this series.

Apologies for the confusion....

- Ted