[rh7,4.1/8] ms/mm/rmap: share the i_mmap_rwsem fix

Submitted by Andrey Ryabinin on Dec. 1, 2020, 11:06 a.m.

Details

Message ID 20201201110628.17838-1-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin Dec. 1, 2020, 11:06 a.m.
Use down_read_nested to avoid lockdep complain.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/mm/rmap.c b/mm/rmap.c
index 523957450d20..90cf61e209ac 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1724,7 +1724,7 @@  static int rmap_walk_file(struct page *page, struct rmap_walk_control *rwc)
 		return ret;
 	pgoff = page_to_pgoff(page);
 
-	i_mmap_lock_read(mapping);
+	down_read_nested(&mapping->i_mmap_rwsem, SINGLE_DEPTH_NESTING);
 	vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) {
 		unsigned long address = vma_address(page, vma);