* [PATCH 1/2] Revert "block: Move checking GENHD_FL_NO_PART to bdev_add_partition()"
@ 2025-11-17 17:43 Gulam Mohamed
2025-11-17 17:43 ` [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART" Gulam Mohamed
0 siblings, 1 reply; 7+ messages in thread
From: Gulam Mohamed @ 2025-11-17 17:43 UTC (permalink / raw)
To: linux-kernel, hch; +Cc: stable
This reverts commit 7777f47f2ea64efd1016262e7b59fab34adfb869.
The commit 1a721de8489f ("block: don't add or resize partition on the disk
with GENHD_FL_NO_PART") and the commit 7777f47f2ea6 ("block: Move checking
GENHD_FL_NO_PART to bdev_add_partition()") used the flag GENHD_FL_NO_PART
to prevent the add or resize of partitions in 5.15 stable kernels.But in
these 5.15 kernels, this is giving an issue with the following error
where the loop driver wants to create a partition when the partscan is
disabled on the loop device:
dd if=/dev/zero of=loopDisk.dsk bs=1M count=1 seek=10240;
losetup -f loopDisk.dsk;parted -s /dev/loop0 -- mklabel gpt mkpart primary
2048s 4096s
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0016293 s, 644 MB/s
""
Error: Partition(s) 1 on /dev/loop0 have been written, but we have been
unable to inform the kernel of the change, probably because it/they are
in use. As a result, the old partition(s) will remain in use. You should
reboot now before making further changes.
""
If the partition scan is not enabled on the loop device, this flag
GENHD_FL_NO_PART is getting set and when partition creation is tried,
it returns an error EINVAL thereby preventing the creation of partitions.
So, there is no such distinction between disabling of partition scan and
partition creation.
Later in 6.xxx kernels, the commit b9684a71fca7 ("block, loop: support
partitions without scanning") a new flag GD_SUPPRESS_PART_SCAN was
introduced that just disables the partition scan and uses GENHD_FL_NO_PART
only to prevent creating partition scan. So, the partition creationg can
proceed with even if partition scan is disabled.
As the commit b9684a71fca7 ("block, loop: support partitions without
scanning") is not available in 5.15 stable kernel, and since there is no
distinction between disabling of "partition scan" and "partition
creation", we need to revert the commits 1a721de8489f and 7777f47f2ea6
from 5.15 stable kernel to allow partition creation when partscan is
disabled.
Cc: stable@vger.kernel.org
Signed-off-by: Gulam Mohamed <gulam.mohamed@oracle.com>
---
block/ioctl.c | 2 ++
block/partitions/core.c | 5 -----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index a260e39e56a4..d25b84441237 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -20,6 +20,8 @@ static int blkpg_do_ioctl(struct block_device *bdev,
struct blkpg_partition p;
sector_t start, length;
+ if (disk->flags & GENHD_FL_NO_PART)
+ return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (copy_from_user(&p, upart, sizeof(struct blkpg_partition)))
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 0d1fe2b42b85..7b5750db7eaf 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -463,11 +463,6 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,
goto out;
}
- if (disk->flags & GENHD_FL_NO_PART) {
- ret = -EINVAL;
- goto out;
- }
-
if (partition_overlaps(disk, start, length, -1)) {
ret = -EBUSY;
goto out;
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART"
2025-11-17 17:43 [PATCH 1/2] Revert "block: Move checking GENHD_FL_NO_PART to bdev_add_partition()" Gulam Mohamed
@ 2025-11-17 17:43 ` Gulam Mohamed
2025-11-18 1:45 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Gulam Mohamed @ 2025-11-17 17:43 UTC (permalink / raw)
To: linux-kernel, hch; +Cc: stable
This reverts commit 1a721de8489fa559ff4471f73c58bb74ac5580d3.
Cc: stable@vger.kernel.org
Signed-off-by: Gulam Mohamed <gulam.mohamed@oracle.com>
---
block/ioctl.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index d25b84441237..a260e39e56a4 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -20,8 +20,6 @@ static int blkpg_do_ioctl(struct block_device *bdev,
struct blkpg_partition p;
sector_t start, length;
- if (disk->flags & GENHD_FL_NO_PART)
- return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (copy_from_user(&p, upart, sizeof(struct blkpg_partition)))
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART"
2025-11-17 17:43 ` [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART" Gulam Mohamed
@ 2025-11-18 1:45 ` Greg KH
2025-11-18 4:58 ` Gulam Mohamed
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2025-11-18 1:45 UTC (permalink / raw)
To: Gulam Mohamed; +Cc: linux-kernel, hch, stable
On Mon, Nov 17, 2025 at 05:43:15PM +0000, Gulam Mohamed wrote:
> This reverts commit 1a721de8489fa559ff4471f73c58bb74ac5580d3.
>
No reason why?
:(
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART"
2025-11-18 1:45 ` Greg KH
@ 2025-11-18 4:58 ` Gulam Mohamed
2025-11-18 8:58 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Gulam Mohamed @ 2025-11-18 4:58 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, hch, stable
Hi Greg,
Thanks for looking into this. This is the 2nd of the two patches I have sent. The first one is "[PATCH 1/2] Revert "block: Move checking GENHD_FL_NO_PART to bdev_add_partition()"". I have mentioned the reason for reverting both these patches in the first patch.
Also, this is for "5.15.y" kernel.
Regards,
Gulam Mohamed.
Confidential- Oracle Internal
> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Tuesday, November 18, 2025 7:15 AM
> To: Gulam Mohamed <gulam.mohamed@oracle.com>
> Cc: linux-kernel@vger.kernel.org; hch@lst.de; stable@vger.kernel.org
> Subject: Re: [PATCH 2/2] Revert "block: don't add or resize partition on the
> disk with GENHD_FL_NO_PART"
>
> On Mon, Nov 17, 2025 at 05:43:15PM +0000, Gulam Mohamed wrote:
> > This reverts commit 1a721de8489fa559ff4471f73c58bb74ac5580d3.
> >
>
> No reason why?
>
> :(
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART"
2025-11-18 4:58 ` Gulam Mohamed
@ 2025-11-18 8:58 ` Greg KH
2025-11-18 9:02 ` Gulam Mohamed
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2025-11-18 8:58 UTC (permalink / raw)
To: Gulam Mohamed; +Cc: linux-kernel, hch, stable
On Tue, Nov 18, 2025 at 04:58:24AM +0000, Gulam Mohamed wrote:
> Hi Greg,
Please do not top-post.
> Thanks for looking into this. This is the 2nd of the two patches I have sent. The first one is "[PATCH 1/2] Revert "block: Move checking GENHD_FL_NO_PART to bdev_add_partition()"". I have mentioned the reason for reverting both these patches in the first patch.
That does not mean anything for this patch, you can not have no
changelog text for it.
> Also, this is for "5.15.y" kernel.
Really? Why? Where did it say that? Please be explicit and say that
somewhere obvious so that we know this.
confused,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART"
2025-11-18 8:58 ` Greg KH
@ 2025-11-18 9:02 ` Gulam Mohamed
2025-11-26 7:01 ` Gulam Mohamed
0 siblings, 1 reply; 7+ messages in thread
From: Gulam Mohamed @ 2025-11-18 9:02 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, hch, stable
Confidential- Oracle Internal
> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Tuesday, November 18, 2025 2:29 PM
> To: Gulam Mohamed <gulam.mohamed@oracle.com>
> Cc: linux-kernel@vger.kernel.org; hch@lst.de; stable@vger.kernel.org
> Subject: Re: [PATCH 2/2] Revert "block: don't add or resize partition on the
> disk with GENHD_FL_NO_PART"
>
> On Tue, Nov 18, 2025 at 04:58:24AM +0000, Gulam Mohamed wrote:
> > Hi Greg,
>
> Please do not top-post.
Sorry. I will take care from next time.
>
> > Thanks for looking into this. This is the 2nd of the two patches I have sent.
> The first one is "[PATCH 1/2] Revert "block: Move checking
> GENHD_FL_NO_PART to bdev_add_partition()"". I have mentioned the
> reason for reverting both these patches in the first patch.
>
> That does not mean anything for this patch, you can not have no changelog
> text for it.
I will add to this patch also.
>
> > Also, this is for "5.15.y" kernel.
>
> Really? Why? Where did it say that? Please be explicit and say that
> somewhere obvious so that we know this.
Sorry, I forgot to include this "5.15.y" in the subject. I will include this and re-send.
Thanks & Regards,
Gulam Mohamed.
>
> confused,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART"
2025-11-18 9:02 ` Gulam Mohamed
@ 2025-11-26 7:01 ` Gulam Mohamed
0 siblings, 0 replies; 7+ messages in thread
From: Gulam Mohamed @ 2025-11-26 7:01 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, hch, stable
Confidential- Oracle Internal
> -----Original Message-----
> From: Gulam Mohamed
> Sent: Tuesday, November 18, 2025 2:32 PM
> To: Greg KH <gregkh@linuxfoundation.org>
> Cc: linux-kernel@vger.kernel.org; hch@lst.de; stable@vger.kernel.org
> Subject: RE: [PATCH 2/2] Revert "block: don't add or resize partition on the
> disk with GENHD_FL_NO_PART"
>
>
>
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Tuesday, November 18, 2025 2:29 PM
> > To: Gulam Mohamed <gulam.mohamed@oracle.com>
> > Cc: linux-kernel@vger.kernel.org; hch@lst.de; stable@vger.kernel.org
> > Subject: Re: [PATCH 2/2] Revert "block: don't add or resize partition
> > on the disk with GENHD_FL_NO_PART"
> >
> > On Tue, Nov 18, 2025 at 04:58:24AM +0000, Gulam Mohamed wrote:
> > > Hi Greg,
> >
> > Please do not top-post.
>
> Sorry. I will take care from next time.
> >
> > > Thanks for looking into this. This is the 2nd of the two patches I have sent.
> > The first one is "[PATCH 1/2] Revert "block: Move checking
> > GENHD_FL_NO_PART to bdev_add_partition()"". I have mentioned the
> > reason for reverting both these patches in the first patch.
> >
> > That does not mean anything for this patch, you can not have no
> > changelog text for it.
> I will add to this patch also.
> >
> > > Also, this is for "5.15.y" kernel.
> >
> > Really? Why? Where did it say that? Please be explicit and say that
> > somewhere obvious so that we know this.
> Sorry, I forgot to include this "5.15.y" in the subject. I will include this and re-
> send.
Greg,
I have resent the patches by including the kernel version "5.15.y" in the subject line.
Can you please review the patches and let us know your comments?
Regards,
Gulam Mohamed.
>
> Thanks & Regards,
> Gulam Mohamed.
> >
> > confused,
> >
> > greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-11-26 7:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17 17:43 [PATCH 1/2] Revert "block: Move checking GENHD_FL_NO_PART to bdev_add_partition()" Gulam Mohamed
2025-11-17 17:43 ` [PATCH 2/2] Revert "block: don't add or resize partition on the disk with GENHD_FL_NO_PART" Gulam Mohamed
2025-11-18 1:45 ` Greg KH
2025-11-18 4:58 ` Gulam Mohamed
2025-11-18 8:58 ` Greg KH
2025-11-18 9:02 ` Gulam Mohamed
2025-11-26 7:01 ` Gulam Mohamed
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®