Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp264178ybb; Thu, 9 Apr 2020 22:47:59 -0700 (PDT) X-Google-Smtp-Source: APiQypLDqXL8iFxE/3T3RyXv9P25eA25npTme9bZQtXyp8BCL9ufoJBlk3q6UHRIbVrJ4rKM/5yr X-Received: by 2002:a37:9b8a:: with SMTP id d132mr2592714qke.286.1586497679380; Thu, 09 Apr 2020 22:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586497679; cv=none; d=google.com; s=arc-20160816; b=S3PvBRk9AeDipYX/Jm5hEtCJUApbLiTetHiN+VFQld688hG/mcbYZuiXVsBgIoknXL MiRHLeQCc2R2+p3Yff2p6QPLQ/I4FhPjOQLHvAF4XcX4KboXc0CqDsjd43ZIsaH2BWxq 1kbQGi8jpKEbB/7P7X364IhwozSnY/jTV2bWVrp6CCGWqCo/kSlc2cx2yujl6nnKaT/O I1hHHqmRaeFDetNOdNCVHp0TqIH3Afn5UFKsT+YmHeAHJL5cI6Z7IDkw9CQTBvvLh85J ba89bgAfYlOmAG9fW1Ie75ScdJsa70oAfesgyYhHw34B1TnVL/SvGm/0AdxbYZe5ppr3 rkxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5YVto1qij8lFDH8bLHlrASxzlQWNhmGgZpL2klqsnnQ=; b=L/xj228k4Ekumovzs0E7LFFt3rbA2WkSsQeeA5LjadcN9LfqOp504iUuGCX5g0jiqk 2B2Ie8Pajsu5VIuQdxe2Yy+IdTsiDgZ6YMiWY6ZGTHheeeEL89OZaMxdViL73l+6yheb QcT8sef2GNR4UKD4iSo/1nEhfs6dshesgKnGwWcM4zXJP9wvAwRcnoN4pRPQX0r4+gHt pRgEi7SiWQcgocGISc3bjg4GqQZjJ4lwMhyiIV/pam0yL/eO6g8BOl5ZXsiEzLOCaI5p zxbFQboJ6T2Qfo6RfODKxLc3x/WZeX6kH5/72x/W7aOzBaz/HnxJ7/gXoHTdi4DvJZdB 731Q== 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 n74si759493qke.375.2020.04.09.22.47.44; Thu, 09 Apr 2020 22:47:59 -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 S1725993AbgDJFps (ORCPT + 99 others); Fri, 10 Apr 2020 01:45:48 -0400 Received: from verein.lst.de ([213.95.11.211]:49645 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbgDJFpr (ORCPT ); Fri, 10 Apr 2020 01:45:47 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id D2EFD68C4E; Fri, 10 Apr 2020 07:45:44 +0200 (CEST) Date: Fri, 10 Apr 2020 07:45:44 +0200 From: Christoph Hellwig To: Qian Cai Cc: Christoph Hellwig , Jens Axboe , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-block@vger.kernel.org, linux-s390@vger.kernel.org, LKML Subject: Re: s390 boot woe due to "block: fix busy device checking in blk_drop_partitions" Message-ID: <20200410054544.GA17923@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please try this patch: --- From f42fb98cc627f9b960fd5b9a3a229da5c5dcf54a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 10 Apr 2020 07:14:13 +0200 Subject: block: fix busy device checking in blk_drop_partitions again The previous fix had an off by one in the bd_openers checking, counting the callers blkdev_get. Fixes: d3ef5536274f ("block: fix busy device checking in blk_drop_partitions") Signed-off-by: Christoph Hellwig --- block/partitions/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 1a0a829d8416..bc1ded1331b1 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -496,7 +496,7 @@ int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev) if (!disk_part_scan_enabled(disk)) return 0; - if (bdev->bd_part_count || bdev->bd_openers) + if (bdev->bd_part_count || bdev->bd_openers > 1) return -EBUSY; res = invalidate_partition(disk, 0); if (res) -- 2.25.1