Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5582731iog; Thu, 23 Jun 2022 00:42:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1urvxvlQBpUWQzPU/SJSxprawd+k57GEkekaHBnwmq6JXzp+yl9OOyfnP4RMiDKzMQaVbAM X-Received: by 2002:a17:90b:4ac9:b0:1ec:9bd1:92ff with SMTP id mh9-20020a17090b4ac900b001ec9bd192ffmr2649905pjb.178.1655970144226; Thu, 23 Jun 2022 00:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655970144; cv=none; d=google.com; s=arc-20160816; b=cV5HfvdVgkO9+5b1ibnF0OuYGIVZZ80Vxc07lfxbDtp3P7AKKLSE8+Z6s3WvzndY2E T/cbKzeh5M1Mh2Ot69i9boJzc6pdm8AXChnlMhn8J1C5aSLOYf5YFQJ4XDuyTZDNZL1R AEVPUnOqnjx4gscqbEtZvah9NMmh/83ln20VH1krwV+NWtzCjWW5Q9aCE82wnXkD7jrU 3uohmEbBa+El3yk0xeV4HPotJpES2kdNE+778UNOxyeyoQO9iAdwmR9ydk9zGkgnK2l+ keJKqCERoDgK7hgk+N3hGvxJnkGMsoW+uTrhekn/jwlm0cIi3qR3DnHyM9oH0LpMizCE kNQg== 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 :message-id:date:subject:cc:to:from; bh=KEocN0j/h4gCqwaXE64QlS721m/gHBfxR1wCgBY2OS8=; b=tx2X7p7ZUoIda8QkKAr2NjxjB2zkExTNSDP8HrBPQmHYWzDgu5e0WOUTtVPGryWt5l saYcjk2yoJ0aZMQzZ12GBxA96g1x8QcWxd9sKVxyzqUfU9NkXqLwd/YMm3+cRrqX/Jf8 7HoBIkuhjjHB3An3fNdB2oh4USmNM/ArmVSfUX1punxirUnAn5+pr6CH2oKFZR9BrwCZ 8UplGWKCwY0pzCFbt4ypVEhPrlFsitJWC3qN4ZEybP3syxw+f2R56hJa8ZO/5rMJ2i2O F3WEVLBPqdTGGEB/TxeYvDXFyMlcKrGJk0I/TGvJmDv6SU0fZwggmn44k7pEhDjkwtgk FHag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a170903230700b00161739962ffsi6290443plh.163.2022.06.23.00.42.12; Thu, 23 Jun 2022 00:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiFWH2U (ORCPT + 99 others); Thu, 23 Jun 2022 03:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbiFWH2Q (ORCPT ); Thu, 23 Jun 2022 03:28:16 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9D3DE9E; Thu, 23 Jun 2022 00:28:08 -0700 (PDT) Received: from dggpeml500021.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LTBfX27Q1zDqqY; Thu, 23 Jun 2022 15:27:32 +0800 (CST) Received: from dggpeml500003.china.huawei.com (7.185.36.200) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 23 Jun 2022 15:28:06 +0800 Received: from huawei.com (10.175.127.227) by dggpeml500003.china.huawei.com (7.185.36.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 23 Jun 2022 15:28:06 +0800 From: Li Nan To: CC: , , , , Subject: [PATCH -next v4] block: remove WARN_ON() from bd_link_disk_holder Date: Thu, 23 Jun 2022 15:41:00 +0800 Message-ID: <20220623074100.2251301-1-linan122@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500003.china.huawei.com (7.185.36.200) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 83cbce957446("block: add error handling for device_add_disk / add_disk"), bdev->bd_holder_dir can not be empty now, so remove WARN_ON() from bd_link_disk_holder. Signed-off-by: Li Nan --- block/holder.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/holder.c b/block/holder.c index 8d750281a1cd..5283bc804cc1 100644 --- a/block/holder.c +++ b/block/holder.c @@ -79,10 +79,6 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) WARN_ON_ONCE(!bdev->bd_holder); - /* FIXME: remove the following once add_disk() handles errors */ - if (WARN_ON(!bdev->bd_holder_dir)) - goto out_unlock; - holder = bd_find_holder_disk(bdev, disk); if (holder) { holder->refcnt++; -- 2.31.1