Description of problem: https://lore.kernel.org/linux-block/20221130175653.24299-1-jack@suse.cz/ Subject: [PATCH] block: Do not reread partition table on exclusively open device Date: Wed, 30 Nov 2022 18:56:53 +0100 [thread overview] Message-ID: <20221130175653.24299-1-jack> (raw) Since commit 10c70d95c0f2 ("block: remove the bd_openers checks in blk_drop_partitions") we allow rereading of partition table although there are users of the block device. This has an undesirable consequence that e.g. if sda and sdb are assembled to a RAID1 device md0 with partitions, BLKRRPART ioctl on sda will rescan partition table and create sda1 device. This partition device under a raid device confuses some programs (such as libstorage-ng used for initial partitioning for distribution installation) leading to failures. Fix the problem refusing to rescan partitions if there is another user that has the block device exclusively open. Link: https://lore.kernel.org/all/20221130135344.2ul4cyfstfs3znxg@quack3 Fixes: 10c70d95c0f2 ("block: remove the bd_openers checks in blk_drop_partitions") Signed-off-by: Jan Kara <jack>
The actual report link: https://lore.kernel.org/linux-block/20221130135344.2ul4cyfstfs3znxg@quack3/
reproduce this is on 5.14.0-205.el9.x86_64, mdadm -CR /dev/md0 -l 1 -n 2 /dev/sda /dev/sdb -e 1.0 sgdisk -n 0:0:+100MiB /dev/md0 cat /proc/partitions mdadm -S /dev/md0 mdadm -A /dev/md0 /dev/sda /dev/sdb cat /proc/partitions # cat /proc/partitions major minor #blocks name 8 0 468851544 sda 8 1 102400 sda1 8 16 468851544 sdb 8 17 102400 sdb1 8 48 468851544 sdd 8 32 468851544 sdc 8 33 1048576 sdc1 8 34 467801088 sdc2 253 0 73400320 dm-0 253 1 8077312 dm-1 253 2 386322432 dm-2 9 0 468851392 md0 259 0 102400 md0p1 # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 447.1G 0 disk ├─sda1 8:1 0 100M 0 part └─md0 9:0 0 447.1G 0 raid1 └─md0p1 259:0 0 100M 0 part sdb 8:16 0 447.1G 0 disk ├─sdb1 8:17 0 100M 0 part └─md0 9:0 0 447.1G 0 raid1 └─md0p1 259:0 0 100M 0 part sdc 8:32 0 447.1G 0 disk ├─sdc1 8:33 0 1G 0 part /boot └─sdc2 8:34 0 446.1G 0 part ├─rhel_storageqe--103-root 253:0 0 70G 0 lvm / ├─rhel_storageqe--103-swap 253:1 0 7.7G 0 lvm [SWAP] └─rhel_storageqe--103-home 253:2 0 368.4G 0 lvm /home sdd 8:48 0 447.1G 0 disk can not reproduce this issue on test kernel 5.14.0-206.mr1740_714212637.el9
this issue no longer be triggered on kernel-5.14.0-225.el9, https://beaker.engineering.redhat.com/recipes/13153324#task154341708 fix patch has been applied to kernel tree, move to verified
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: kernel security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:2458