diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2020-09-17 08:17:48 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2020-12-05 19:40:07 +0100 |
commit | 4c0708c37959ac70f139b5f4fa0926611a48df5c (patch) | |
tree | bbb66db4b23dd1dcaa83548ea58b5bdd92d62070 /SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch | |
parent | c9587a13a67eda0476637dd110161b93f23c7b3c (diff) | |
download | kernel-fsync-4c0708c37959ac70f139b5f4fa0926611a48df5c.tar.gz kernel-fsync-4c0708c37959ac70f139b5f4fa0926611a48df5c.zip |
kernel 5.8.9
Diffstat (limited to 'SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch')
-rw-r--r-- | SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch b/SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch new file mode 100644 index 0000000..476eb1a --- /dev/null +++ b/SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch @@ -0,0 +1,38 @@ +From 10b34a18180269103dafc68f1a4257ae61c87415 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Tue, 8 Sep 2020 16:15:06 +0200 +Subject: block: restore a specific error code in bdev_del_partition + +From: Christoph Hellwig <hch@lst.de> + +[ Upstream commit 88ce2a530cc9865a894454b2e40eba5957a60e1a ] + +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: 08fc1ab6d748 ("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> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + 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 534e11285a8d4..b45539764c994 100644 +--- a/block/partitions/core.c ++++ b/block/partitions/core.c +@@ -529,7 +529,7 @@ int bdev_del_partition(struct block_device *bdev, int partno) + + bdevp = bdget_disk(bdev->bd_disk, partno); + if (!bdevp) +- return -ENOMEM; ++ return -ENXIO; + + mutex_lock(&bdevp->bd_mutex); + mutex_lock_nested(&bdev->bd_mutex, 1); +-- +2.25.1 + |