Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp633936pxv; Thu, 15 Jul 2021 12:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPX/zX9BcZgMFQsdkwI745GHllBHtd4QNP8n7TWBOsILXNpeNotco1FIxfhOZ+4nK/JI75 X-Received: by 2002:a05:6602:3342:: with SMTP id c2mr4116502ioz.126.1626375828020; Thu, 15 Jul 2021 12:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375828; cv=none; d=google.com; s=arc-20160816; b=MEwgyqHnVGFFJR6Y2fJnSQso0mcQjeJdjOLdC6LkkmO5m/ZGQAujvrkud1nb4lBrPt sPlKTtpcGeWthp8Ttd5GSFboQZn38X+MwtQbNtK6+c2C+KsTT5rb7J5UgITdfldW1f5F 0iJdk8+Fb+JBDgCagPFxh1rboyC4cB+XtXW4C79Japaa8JK5Lg8WjxzcTT2NII4/JLrF LQyE81ln8YwTokiD1O0+mAjujw+KmF2f2fmzDHPaJXHLwqk5p874/9YfnNomVA9nn7HI 8c07BcD8zC2GIBGLsRyQtmpeuWyHXPK9Z6FYDULMYQsXygIIkz1pCRJPxpa3/3KFdokF uimQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xwAMwLsW5A3vu8r9Ol1B4GjhDQs3LggxDyfndMWQ7EY=; b=ZjYbAnc490nOBz5VANfXFPN/hob3zyRlQpJwbel/uXhG+Ys8CGHNiNhDrzvFcG02CI zoFOIUCsPm2CPBFOXBGMhiHRL0QIhnYuwM8Me3zNkOwWWEXkV2skFe0H/VU56qP+BLrU OWNtboKLYIYUxN+5rKQWhKGnJd7XS5x9ZhrtOPRpTbGf3+MGz501VjeMztAbKhqZSN6V v9f16DEH3Rxy5cEIhuWJc4eDaicnEdG1KsHsy90roQ+OfZhLNi0RzBPiIGYApBD6t0NN +aZbWFX9SJHHYa5Z9pycLkMNylnWgzpEgW0cpKlNAbMi8IwCa6WfcphaqngDZZwUle0V qZwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="D7/sRP+s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g24si7729010jaq.119.2021.07.15.12.03.34; Thu, 15 Jul 2021 12:03:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="D7/sRP+s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243441AbhGOTEY (ORCPT + 99 others); Thu, 15 Jul 2021 15:04:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:58428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239531AbhGOSxx (ORCPT ); Thu, 15 Jul 2021 14:53:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA109613CA; Thu, 15 Jul 2021 18:50:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375060; bh=/aw41K5/NSchCtxNyxON9OJdJYhSrdRVM1wLVHcs0hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7/sRP+s950+4qtxnEXyHA6xUgLOCelPo8nZLdp2YGPCNn/9VTD8os4BhfKPGVIes G6UA/HYvyzIBx2xiSOLQirepD/FDMjwVmlVH/ehRbBaW9wwhXcUEXhc93XkPMqY62E eFD0bYzPw1yUg+X5MrjxEx7JXtMhQ4oN+xvfgdkw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Oscar Salvador , Naoya Horiguchi , Vlastimil Babka , David Hildenbrand , Andrew Morton , Linus Torvalds , Hanjun Guo Subject: [PATCH 5.10 140/215] mm,hwpoison: return -EBUSY when migration fails Date: Thu, 15 Jul 2021 20:38:32 +0200 Message-Id: <20210715182624.294004469@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oscar Salvador 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 Acked-by: Naoya Horiguchi Acked-by: Vlastimil Babka Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Hanjun Guo Signed-off-by: Greg Kroah-Hartman --- mm/memory-failure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1856,11 +1856,11 @@ static int __soft_offline_page(struct pa 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;