Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B978EC43219 for ; Thu, 25 Apr 2019 17:41:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48BED2088F for ; Thu, 25 Apr 2019 17:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556214067; bh=pbAD0vpyr17I3OdJl6LgaWlLqUCpNFLZRA+aDtRmPZ4=; h=Subject:To:From:Date:List-ID:From; b=pEnI/g4aWSVSqL1BZnmOVREv/8SyOVH5i65gpq17esA4N0OrBbXIRlmas9DUq0heR qkhgXM0/u9dZj1zv+Wo0+/Y2CftqxFFdQxuMADVyVvJ+IODphJre6HKg/ylbT+zZ9G UHzYoQOvQ0dfqzinLC3rE/0dYheVhA6Hyebbisj4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729665AbfDYRlG (ORCPT ); Thu, 25 Apr 2019 13:41:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726916AbfDYRlF (ORCPT ); Thu, 25 Apr 2019 13:41:05 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 60AFE2084F; Thu, 25 Apr 2019 17:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556214065; bh=pbAD0vpyr17I3OdJl6LgaWlLqUCpNFLZRA+aDtRmPZ4=; h=Subject:To:From:Date:From; b=2m084RNeHeM9no06jOvc+fJPZLbeeh7KCkVWF6GcA4a5s2anTwuiRGmkG3vwdFJCz ZWgFB2s4ZqW8fzInhVw+MwVFxbjgksrOUuG2i4YmwzQy1zXp5BuXBbWmOxqdrSjcsG CWDqpOYU/gomZ90is8Hdhdt5d8nslRrZsCQ1oJ1k= Subject: patch "mm/memory_hotplug: Do not unlock when fails to take the" added to driver-core-testing To: zhongjiang@huawei.com, david@redhat.com, gregkh@linuxfoundation.org, mhocko@suse.com, osalvador@suse.de, stable@vger.kernel.org, yangyingliang@huawei.com From: Date: Thu, 25 Apr 2019 19:41:02 +0200 Message-ID: <15562140621720@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled mm/memory_hotplug: Do not unlock when fails to take the to my driver-core git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git in the driver-core-testing branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will be merged to the driver-core-next branch sometime soon, after it passes testing, and the merge window is open. If you have any questions about this process, please let me know. From d2ab99403ee00d8014e651728a4702ea1ae5e52c Mon Sep 17 00:00:00 2001 From: zhong jiang Date: Mon, 8 Apr 2019 12:07:17 +0800 Subject: mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock When adding the memory by probing memory block in sysfs interface, there is an obvious issue that we will unlock the device_hotplug_lock when fails to takes it. That issue was introduced in Commit 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock") We should drop out in time when fails to take the device_hotplug_lock. Fixes: 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock") Reported-by: Yang yingliang Signed-off-by: zhong jiang Reviewed-by: Oscar Salvador Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index cb8347500ce2..e49028a60429 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -506,7 +506,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, ret = lock_device_hotplug_sysfs(); if (ret) - goto out; + return ret; nid = memory_add_physaddr_to_nid(phys_addr); ret = __add_memory(nid, phys_addr, -- 2.21.0