Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdbf8897 authored by Ross Zwisler's avatar Ross Zwisler Committed by Theodore Ts'o
Browse files

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: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
parent 0694f8c3
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -566,7 +566,8 @@ struct page *dax_layout_busy_page(struct address_space *mapping)
			if (index >= end)
			if (index >= end)
				break;
				break;


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


			xa_lock_irq(&mapping->i_pages);
			xa_lock_irq(&mapping->i_pages);
@@ -578,6 +579,13 @@ struct page *dax_layout_busy_page(struct address_space *mapping)
			if (page)
			if (page)
				break;
				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_remove_exceptionals(&pvec);
		pagevec_release(&pvec);
		pagevec_release(&pvec);
		index++;
		index++;