On Fri, Oct 14, 2022 at 04:57:37PM -0700, Dan Williams wrote: > In preparation for dax_insert_entry() to start taking page and pgmap > references ensure that page->pgmap is valid by holding the > dax_read_lock() over both dax_direct_access() and dax_insert_entry(). > > I.e. the code that wants to elevate the reference count of a pgmap page > from 0 -> 1 must ensure that the pgmap is not exiting and will not start > exiting until the proper references have been taken. I'm surprised we can have a vmfault while the pgmap is exiting? Shouldn't the FS have torn down all the inodes before it starts killing the pgmap? And since tearing down all the inodes now ensures all the pages have 0 reference, why do we need to do anything with the pgmap? Jason