Skip to content

Commit 052c467

Browse files
committed
Merge tag 'block-5.7-2020-05-01' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "A few fixes for this release: - NVMe pull request from Christoph, with a single fix for a double free in the namespace error handling. - Kill the bd_openers check in blk_drop_partitions(), fixing a regression in this merge window (Christoph)" * tag 'block-5.7-2020-05-01' of git://git.kernel.dk/linux-block: block: remove the bd_openers checks in blk_drop_partitions nvme: prevent double free in nvme_alloc_ns() error handling
2 parents ab386c4 + 10c70d9 commit 052c467

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

block/partitions/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev)
496496

497497
if (!disk_part_scan_enabled(disk))
498498
return 0;
499-
if (bdev->bd_part_count || bdev->bd_openers > 1)
499+
if (bdev->bd_part_count)
500500
return -EBUSY;
501501
res = invalidate_partition(disk, 0);
502502
if (res)

drivers/nvme/host/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3642,6 +3642,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
36423642

36433643
return;
36443644
out_put_disk:
3645+
/* prevent double queue cleanup */
3646+
ns->disk->queue = NULL;
36453647
put_disk(ns->disk);
36463648
out_unlink_ns:
36473649
mutex_lock(&ctrl->subsys->lock);

0 commit comments

Comments
 (0)