public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: <stable@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>,
	Oscar Salvador <osalvador@suse.de>,
	David Hildenbrand <david@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Hanjun Guo <guohanjun@huawei.com>
Subject: [Backport for 5.10.y PATCH 2/7] mm,hwpoison: return -EBUSY when migration fails
Date: Tue, 13 Jul 2021 17:18:32 +0800	[thread overview]
Message-ID: <1626167917-11972-3-git-send-email-guohanjun@huawei.com> (raw)
In-Reply-To: <1626167917-11972-1-git-send-email-guohanjun@huawei.com>

From: Oscar Salvador <osalvador@suse.de>

commit 3f4b815a439adfb8f238335612c4b28bc10084d8

Currently, we return -EIO when we fail to migrate the page.

Migrations' failures are rather transient as they can happen due to
several reasons, e.g: high page refcount bump, mapping->migrate_page
failing etc.  All meaning that at that time the page could not be
migrated, but that has nothing to do with an EIO error.

Let us return -EBUSY instead, as we do in case we failed to isolate the
page.

While are it, let us remove the "ret" print as its value does not change.

Link: https://lkml.kernel.org/r/20201209092818.30417-1-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 mm/memory-failure.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 25fb82320..01445dd 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1856,11 +1856,11 @@ static int __soft_offline_page(struct page *page)
 			pr_info("soft offline: %#lx: %s migration failed %d, type %lx (%pGp)\n",
 				pfn, msg_page[huge], ret, page->flags, &page->flags);
 			if (ret > 0)
-				ret = -EIO;
+				ret = -EBUSY;
 		}
 	} else {
-		pr_info("soft offline: %#lx: %s isolation failed: %d, page count %d, type %lx (%pGp)\n",
-			pfn, msg_page[huge], ret, page_count(page), page->flags, &page->flags);
+		pr_info("soft offline: %#lx: %s isolation failed, page count %d, type %lx (%pGp)\n",
+			pfn, msg_page[huge], page_count(page), page->flags, &page->flags);
 		ret = -EBUSY;
 	}
 	return ret;
-- 
1.7.12.4


  parent reply	other threads:[~2021-07-13  9:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  9:18 [Backport for 5.10.y PATCH 0/7] Patches for 5.10.y Hanjun Guo
2021-07-13  9:18 ` [Backport for 5.10.y PATCH 1/7] loop: fix I/O error on fsync() in detached loop devices Hanjun Guo
2021-07-13  9:18 ` Hanjun Guo [this message]
2021-07-13  9:18 ` [Backport for 5.10.y PATCH 3/7] io_uring: simplify io_remove_personalities() Hanjun Guo
2021-07-13  9:18 ` [Backport for 5.10.y PATCH 4/7] io_uring: Convert personality_idr to XArray Hanjun Guo
2021-07-13  9:18 ` [Backport for 5.10.y PATCH 5/7] io_uring: convert io_buffer_idr " Hanjun Guo
2021-07-13  9:18 ` [Backport for 5.10.y PATCH 6/7] scsi: iscsi: Fix race condition between login and sync thread Hanjun Guo
2021-07-13  9:18 ` [Backport for 5.10.y PATCH 7/7] scsi: iscsi: Fix iSCSI cls conn state Hanjun Guo
2021-07-15 11:12 ` [Backport for 5.10.y PATCH 0/7] Patches for 5.10.y Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1626167917-11972-3-git-send-email-guohanjun@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osalvador@suse.de \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox