diff options
author | Justin M. Forbes <jforbes@fedoraproject.org> | 2020-09-14 12:54:42 -0500 |
---|---|---|
committer | Justin M. Forbes <jforbes@fedoraproject.org> | 2020-09-14 12:54:42 -0500 |
commit | 8e87aba0e387c72cd9e0cfa9560edf221c99c34f (patch) | |
tree | 2a8bf02f415ea805ff8f3d4fb4851e6078d7be1f | |
parent | 7f97617b93b6686794fa75f793181180161e413b (diff) | |
download | kernel-8e87aba0e387c72cd9e0cfa9560edf221c99c34f.tar.gz kernel-8e87aba0e387c72cd9e0cfa9560edf221c99c34f.tar.xz kernel-8e87aba0e387c72cd9e0cfa9560edf221c99c34f.zip |
Fix error code in bdev_del_part (rhbz 1878858)
Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
-rw-r--r-- | block-restore-a-specific-error-code-in-bdev_del_part.patch | 38 | ||||
-rw-r--r-- | kernel.spec | 8 |
2 files changed, 45 insertions, 1 deletions
diff --git a/block-restore-a-specific-error-code-in-bdev_del_part.patch b/block-restore-a-specific-error-code-in-bdev_del_part.patch new file mode 100644 index 000000000..476eb1ab6 --- /dev/null +++ b/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 + diff --git a/kernel.spec b/kernel.spec index 7dee014f9..f216a908e 100644 --- a/kernel.spec +++ b/kernel.spec @@ -77,7 +77,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 100 +%global baserelease 101 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -869,6 +869,9 @@ Patch110: memory-tegra-Remove-GPU-from-DRM-IOMMU-group.patch # CVE-2020-25211 rhbz 1877571 1877572 Patch111: netfilter-ctnetlink-add-range-check-for-l3-l4-protonum.patch +# rhbz 1878858 +Patch112: block-restore-a-specific-error-code-in-bdev_del_part.patch + # END OF PATCH DEFINITIONS %endif @@ -2973,6 +2976,9 @@ fi # # %changelog +* Mon Sep 14 2020 Justin M. Forbes <jforbes@fedoraproject.org> - 5.8.9-101 +- Fix error code in bdev_del_part (rhbz 1878858) + * Mon Sep 14 08:51:55 CDT 2020 Justin M. Forbes <jforbes@fedoraproject.org> - 5.8.9-100 - Linux v5.8.9 |