Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>

authored by

Ross Zwisler and committed by
Theodore Ts'o
cdbf8897 0694f8c3

+9 -1
+9 -1
fs/dax.c
··· 566 566 if (index >= end) 567 567 break; 568 568 569 - if (!radix_tree_exceptional_entry(pvec_ent)) 569 + if (WARN_ON_ONCE( 570 + !radix_tree_exceptional_entry(pvec_ent))) 570 571 continue; 571 572 572 573 xa_lock_irq(&mapping->i_pages); ··· 579 578 if (page) 580 579 break; 581 580 } 581 + 582 + /* 583 + * We don't expect normal struct page entries to exist in our 584 + * tree, but we keep these pagevec calls so that this code is 585 + * consistent with the common pattern for handling pagevecs 586 + * throughout the kernel. 587 + */ 582 588 pagevec_remove_exceptionals(&pvec); 583 589 pagevec_release(&pvec); 584 590 index++;