Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-01-16 14:16:19 +0100
committerJan Kara <jack@suse.cz>2019-01-21 09:16:10 +0100
commitc5fc644d1f82ef52da5f46823d53308c281fc6b2 (patch)
tree8886befe582f365d7eba30c9cb2ca6792ff3bb86
parent32da7b48556a93d4ebb9d19a677658ae022dca2e (diff)
mm: migrate: Make buffer_migrate_page_norefs() actually succeed
(bsc#1084216)
-rw-r--r--patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch b/patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch
new file mode 100644
index 0000000000..4d7a160ebd
--- /dev/null
+++ b/patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch
@@ -0,0 +1,62 @@
+From: Jan Kara <jack@suse.cz>
+Date: Wed, 16 Jan 2019 11:02:48 +0100
+Subject: [PATCH] mm: migrate: Make buffer_migrate_page_norefs() actually succeed
+References: bsc#1084216
+Patch-mainline: No, submitted Jan 16 2019
+
+Currently, buffer_migrate_page_norefs() was constantly failing because
+buffer_migrate_lock_buffers() grabbed reference on each buffer. In fact,
+there's no reason for buffer_migrate_lock_buffers() to grab any buffer
+references as the page is locked during all our operation and thus
+nobody can reclaim buffers from the page. So remove grabbing of buffer
+references which also makes buffer_migrate_page_norefs() succeed.
+
+Fixes: 89cb0888ca14 "mm: migrate: provide buffer_migrate_page_norefs()"
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Jan Kara <jack@suse.cz>
+---
+ mm/migrate.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/mm/migrate.c b/mm/migrate.c
+index a16b15090df3..712b231a7376 100644
+--- a/mm/migrate.c
++++ b/mm/migrate.c
+@@ -709,7 +709,6 @@ static bool buffer_migrate_lock_buffers(struct buffer_head *head,
+ /* Simple case, sync compaction */
+ if (mode != MIGRATE_ASYNC) {
+ do {
+- get_bh(bh);
+ lock_buffer(bh);
+ bh = bh->b_this_page;
+
+@@ -720,18 +719,15 @@ static bool buffer_migrate_lock_buffers(struct buffer_head *head,
+
+ /* async case, we cannot block on lock_buffer so use trylock_buffer */
+ do {
+- get_bh(bh);
+ if (!trylock_buffer(bh)) {
+ /*
+ * We failed to lock the buffer and cannot stall in
+ * async migration. Release the taken locks
+ */
+ struct buffer_head *failed_bh = bh;
+- put_bh(failed_bh);
+ bh = head;
+ while (bh != failed_bh) {
+ unlock_buffer(bh);
+- put_bh(bh);
+ bh = bh->b_this_page;
+ }
+ return false;
+@@ -818,7 +814,6 @@ static int __buffer_migrate_page(struct address_space *mapping,
+ bh = head;
+ do {
+ unlock_buffer(bh);
+- put_bh(bh);
+ bh = bh->b_this_page;
+
+ } while (bh != head);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index c2e0d107c0..a86e07642e 100644
--- a/series.conf
+++ b/series.conf
@@ -19890,6 +19890,7 @@
patches.kabi/0001-hwpoison-memory_hotplug-allow-hwpoisoned-pages-to-be-kabi.patch
patches.fixes/vfs-Avoid-softlockups-in-drop_pagecache_sb.patch
+ patches.fixes/mm-migrate-Make-buffer_migrate_page_norefs-actually-.patch
########################################################
# misc small fixes