From: Christoph Hellwig <hch@lst.de>
To: Qian Cai <cai@lca.pw>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
linux-block@vger.kernel.org, linux-s390@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: s390 boot woe due to "block: fix busy device checking in blk_drop_partitions"
Date: Fri, 10 Apr 2020 07:45:44 +0200 [thread overview]
Message-ID: <20200410054544.GA17923@lst.de> (raw)
In-Reply-To: <AD16A450-794F-4EEA-A7BF-42452F18294A@lca.pw>
Please try this patch:
---
From f42fb98cc627f9b960fd5b9a3a229da5c5dcf54a Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
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 <hch@lst.de>
---
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
next prev parent reply other threads:[~2020-04-10 5:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-09 23:33 s390 boot woe due to "block: fix busy device checking in blk_drop_partitions" Qian Cai
2020-04-10 5:45 ` Christoph Hellwig [this message]
2020-04-10 12:20 ` Qian Cai
2020-04-23 11:07 ` Michal Koutný
2020-04-27 16:10 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200410054544.GA17923@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=borntraeger@de.ibm.com \
--cc=cai@lca.pw \
--cc=gor@linux.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.