RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2149790 - [PATCH] block: Do not reread partition table on exclusively open device
Summary: [PATCH] block: Do not reread partition table on exclusively open device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: kernel
Version: 9.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ming Lei
QA Contact: ChanghuiZhong
URL:
Whiteboard:
Depends On:
Blocks: 2151112
TreeView+ depends on / blocked
 
Reported: 2022-11-30 23:37 UTC by Ming Lei
Modified: 2023-05-09 10:02 UTC (History)
2 users (show)

Fixed In Version: kernel-5.14.0-225.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2151112 (view as bug list)
Environment:
Last Closed: 2023-05-09 08:09:03 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/src/kernel centos-stream-9 merge_requests 1740 0 None opened block: Do not reread partition table on exclusively open device 2022-12-06 03:23:40 UTC
Red Hat Issue Tracker RHELPLAN-140986 0 None None None 2022-11-30 23:39:21 UTC
Red Hat Product Errata RHSA-2023:2458 0 None None None 2023-05-09 08:09:38 UTC

Description Ming Lei 2022-11-30 23:37:57 UTC
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>

Comment 1 Ming Lei 2022-11-30 23:41:07 UTC
The actual report link:

https://lore.kernel.org/linux-block/20221130135344.2ul4cyfstfs3znxg@quack3/

Comment 4 ChanghuiZhong 2022-12-19 10:17:04 UTC
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

Comment 8 ChanghuiZhong 2022-12-27 03:19:37 UTC
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

Comment 10 errata-xmlrpc 2023-05-09 08:09:03 UTC
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


Note You need to log in before you can comment on or make changes to this bug.