On 01/18/2018 03:07 PM, Matthew Wilcox wrote: > On Thu, Jan 18, 2018 at 02:38:39PM +0100, Jan H. Schönherr wrote: >> The function follow_pte_pmd() can theoretically return after having >> acquired a PMD lock, even when DAX was not compiled with >> CONFIG_FS_DAX_PMD. > > I don't think it can. How would a PMD entry get into a DAX VMA if we > compiled the kernel without CONFIG_FS_DAX_PMD? > Maybe it can not in happy cases. But the PMD parts in follow_pte_pmd() are compiled in unconditionally. So, if there's an issue elsewhere, and for some weird reason we get a PMD entry in the page table, it would screw the lock balance. I haven't run into an actual issue with this, it's just supposed to be defensive. Regards Jan