Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2502350yba; Sun, 7 Apr 2019 21:11:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQthFdVBlGC8eGGtrkyMVB468v035hnyZdyO91F9UIX0NccBHVSAwhdie49qQ0Ncv5Dskt X-Received: by 2002:a62:4815:: with SMTP id v21mr9380301pfa.224.1554696702172; Sun, 07 Apr 2019 21:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554696702; cv=none; d=google.com; s=arc-20160816; b=eNfqIvPNM5wvwW6K9e/pg25BvfASn1ZxP9nza49FBhBLCHEj2hbEJxkLkyvd0fXKV8 x2tFnyg9YnhfGMLdE4cJR0c5G41TAjwn0afbzak+4q+GzkpJCR7K2XZomg3S/A92gvvc f33F9ZMXZKjPrI3oqB/L9fz9IeoYChzWdTxN8Xda03dTW/POAD80m0zcA9kdQaeyZC83 R5dlUO1hcRNfB5v77lBNbsfh5uQ6mwYoxC7QlnZNcJ8ISmcA/aSe811NYPPUrerTYAXg me13PMlgAwNtQufA2l86bh7JVvN9/1cI4coy8VU7R6yV7rwvsult2rtXpxjd7jf4NpNA 3lfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=b5sznIioWGEpJugfwCT/wZ++mYHhvA/9vVZtqOrlnM8=; b=IVfIdt/oYaofh7pdzO8E33AuqQqJ5Lz7lwEgUr1S3F0P2zhKpT6QN//zmWbYCowWB5 1a6NQ1kp3HkpO3v2KkcvxzmfXdEbKk/AWTz+LOhFceT7pNnb8S9VBZbqrmX62UiEUudC gdVqUxXRtjH+pDYiPCLnooP7bmtantq8L6xmp/LjNx2pluyVlRcux2BmCzyf/STU4W9o uQKz9g1Gkp3KzY/44MT7dKOrv62a1b4LbzEyNY9ybNRPf7MbyzBoPz6da4HIKD44zk6n Mx+8NEO+OwOvzKP1Fj0bZk9zu79fMhdeDRi9ny6IMDGm3SzqpswPRyrHIMlxCq3iJIpe t1JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si25408546pgn.93.2019.04.07.21.11.26; Sun, 07 Apr 2019 21:11:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725984AbfDHEKv (ORCPT + 99 others); Mon, 8 Apr 2019 00:10:51 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:38418 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725877AbfDHEKu (ORCPT ); Mon, 8 Apr 2019 00:10:50 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 55C5DACF789DC3F79613; Mon, 8 Apr 2019 12:10:49 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Mon, 8 Apr 2019 12:10:39 +0800 Message-ID: <5CAAC9BD.5080400@huawei.com> Date: Mon, 8 Apr 2019 12:10:37 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: , , , , , CC: , , , , , , Subject: Re: [PATCH] mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock References: <1554696012-9254-1-git-send-email-zhongjiang@huawei.com> In-Reply-To: <1554696012-9254-1-git-send-email-zhongjiang@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I am sorry, It is incorrect. please ignore the patch. I will resent it. Thanks, zhong jiang On 2019/4/8 12:00, zhong jiang wrote: > 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 > --- > 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 d9ebb89..8b0cec7 100644 > --- a/drivers/base/memory.c > +++ b/drivers/base/memory.c > @@ -507,7 +507,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, > > ret = lock_device_hotplug_sysfs(); > if (ret) > - goto out; > + goto ret; > > nid = memory_add_physaddr_to_nid(phys_addr); > ret = __add_memory(nid, phys_addr,