Skip to content

Commit 88ce2a5

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: restore a specific error code in bdev_del_partition
mdadm relies on the fact that deleting an invalid partition returns -ENXIO or -ENOTTY to detect if a block device is a partition or a whole device. Fixes: 08fc1ab ("block: fix locking in bdev_del_partition") Reported-by: kernel test robot <rong.a.chen@intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 7e24969 commit 88ce2a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/partitions/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ int bdev_del_partition(struct block_device *bdev, int partno)
537537

538538
bdevp = bdget_disk(bdev->bd_disk, partno);
539539
if (!bdevp)
540-
return -ENOMEM;
540+
return -ENXIO;
541541

542542
mutex_lock(&bdevp->bd_mutex);
543543
mutex_lock_nested(&bdev->bd_mutex, 1);

0 commit comments

Comments
 (0)