Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1590026pxb; Fri, 27 Aug 2021 12:20:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWiADxObF0kUNqfX5mGomd70OTMxZGQyW9Bn2CS+NoZHLDmVmg4U2lEgX61RF4WqQ128G3 X-Received: by 2002:a05:6638:40ab:: with SMTP id m43mr5577796jam.110.1630092020062; Fri, 27 Aug 2021 12:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630092020; cv=none; d=google.com; s=arc-20160816; b=eK9pJR7utuNZyDwYXHPk9evlOAbmEyJRE5XPIfLaGIjibfDANA7uoGEv/W/BmTw45W QXLP0d787nlzLUnsAD5PNL60uLl9nUm2RnaHdP2fFpHctpc2QmMCnF8r+UBbzyVFFIm6 2qJfpTPcw5VV8jr6lVom+P0hE1qU0LS/1+7/1tA9KjhhF0meGMjdPAL2R5ZfBgntWHxq yeiXJ19oPncMlJDuts619SICF6vFwb3h9XW3XwlT0XWZqd7RILAIqwOXmW+degB4GZ38 ly0Y9eBWILY82tKHwZi546xJzDrKCrN3QiKIXZsm9SL+X+JcX+bvsip6JIwYK2MkkrLk 6ROg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jzYOtCWATAY/QPQDMVi4thNHaE7QBEtJ34Au5e0E3sY=; b=UGNzpULZo9WCCoiJzHnXRpWXQ58qdMO+BjygyQ7+SwHOZ1dLY8nQATw0hmvVUbsrDs ZAiMujO8PT9mY2eyEF5cGtizn+U1OoyuWMvgteYvRHFB1/adUxT3S9R6hVrvXBBv5PRh bZSiGtiehBA/IA/65d8CU5nh2+AS/M+syY0RV5HLba8TUgsi7X+N937BAx2ImJRqjP7q H/7LSUsE5PXLjNVPLExuGx4rWl4IJgz06tH/ZZMUuNmge+KAMV9dQlyznzG4IY4yrFVA 9IFX64GrFde8EYKE3No7Aem+CDpsRv95P1aFQdWW41WP7WrMRvFXKSy/+pb0IyXvQLk8 k8jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=NGugnaXz; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e101si6289037jai.50.2021.08.27.12.20.09; Fri, 27 Aug 2021 12:20:20 -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=@infradead.org header.s=bombadil.20210309 header.b=NGugnaXz; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231598AbhH0TUQ (ORCPT + 99 others); Fri, 27 Aug 2021 15:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231202AbhH0TTP (ORCPT ); Fri, 27 Aug 2021 15:19:15 -0400 Received: from bombadil.infradead.org (unknown [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE4DC061757; Fri, 27 Aug 2021 12:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=jzYOtCWATAY/QPQDMVi4thNHaE7QBEtJ34Au5e0E3sY=; b=NGugnaXzgKO6Z0LTp/maSzbHCI U1Pv2fbRzAJNKgHx+R1PcMKo8uKSrgNlQix8oa8+K/HTha83E2mjqGnrSagG+ONnMAFMGLYtn2PNe 44srzTowUzh4ka5s84uHYFW/HOBtfUpMoE0PLBnDtbqqm8TmqnPx5RKDFqaaFTEw0A10vtOcAGog8 s3kmxVpMLBGvEEyhgCLpkdmj9S06UEdmTMQCo1Nwra6wRObz47JLIzPDf3ciTJiFUmRYdKNCEMx93 /RmF44E3FegHXxtVo6avCvgPzF7TiKeyMgBT3BlZk/PF5la1GXJhEiw3DATVEgKTEH2u5aQi1PQpl Km4814lA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJhMh-00D5Ay-6k; Fri, 27 Aug 2021 19:18:11 +0000 From: Luis Chamberlain To: axboe@kernel.dk, colyli@suse.de, kent.overstreet@gmail.com, kbusch@kernel.org, sagi@grimberg.me, vishal.l.verma@intel.com, dan.j.williams@intel.com, dave.jiang@intel.com, ira.weiny@intel.com, konrad.wilk@oracle.com, roger.pau@citrix.com, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, minchan@kernel.org, ngupta@vflare.org, senozhatsky@chromium.org Cc: xen-devel@lists.xenproject.org, nvdimm@lists.linux.dev, linux-nvme@lists.infradead.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 04/10] nvdimm/btt: do not call del_gendisk() if not needed Date: Fri, 27 Aug 2021 12:18:03 -0700 Message-Id: <20210827191809.3118103-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210827191809.3118103-1-mcgrof@kernel.org> References: <20210827191809.3118103-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We know we don't need del_gendisk() if we haven't added the disk, so just skip it. This should fix a bug on older kernels, as del_gendisk() became able to deal with disks not added only recently, after the patch titled "block: add flag for add_disk() completion notation". Signed-off-by: Luis Chamberlain --- drivers/nvdimm/btt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 92dec4952297..3fd1bdb9fc05 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -1538,7 +1538,6 @@ static int btt_blk_init(struct btt *btt) int rc = nd_integrity_init(btt->btt_disk, btt_meta_size(btt)); if (rc) { - del_gendisk(btt->btt_disk); blk_cleanup_disk(btt->btt_disk); return rc; } -- 2.30.2