Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2019-07-18 10:05:31 +0100
committerMel Gorman <mgorman@suse.de>2019-07-18 10:05:31 +0100
commit4cd44aa7c0864138019e38626beb5823238ac072 (patch)
tree9ec4a1f3aea6d1501a8a62b7420f3dd093864e0d
parent19327c8d7b562ea9dc2199e3b211e7170e00b844 (diff)
mm: migrate: Fix reference check race between __find_get_block()
-rw-r--r--mm/migrate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index a157d67877c5..42ec22a3c2c0 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -763,12 +763,12 @@ recheck_buffers:
}
bh = bh->b_this_page;
} while (bh != head);
- spin_unlock(&mapping->private_lock);
if (busy) {
if (invalidated) {
rc = -EAGAIN;
goto unlock_buffers;
}
+ spin_unlock(&mapping->private_lock);
invalidate_bh_lrus();
invalidated = true;
goto recheck_buffers;
@@ -801,6 +801,8 @@ recheck_buffers:
rc = MIGRATEPAGE_SUCCESS;
unlock_buffers:
+ if (check_refs)
+ spin_unlock(&mapping->private_lock);
bh = head;
do {
unlock_buffer(bh);