diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index a3f9a8ccec0f..320c42e95e69 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2427,11 +2427,16 @@ void unmap_mapping_range(struct address_space *mapping, details.last_index = ULONG_MAX; - /* DAX uses i_mmap_lock to serialise file truncate vs page fault */ - i_mmap_lock_write(mapping); + /* + * DAX already holds i_mmap_lock to serialise file truncate vs + * page fault and page fault vs page fault. + */ + if (!IS_DAX(mapping->host)) + i_mmap_lock_write(mapping); if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap))) unmap_mapping_range_tree(&mapping->i_mmap, &details); - i_mmap_unlock_write(mapping); + if (!IS_DAX(mapping->host)) + i_mmap_unlock_write(mapping); } EXPORT_SYMBOL(unmap_mapping_range); |