lkml.org 
[lkml]   [2024]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: PROBLEM: BLKPG_DEL_PARTITION with GENHD_FL_NO_PART used to return ENXIO, now returns EINVAL
Hi Allison,

please try this minimal fix. I need to double check if we historically
returned ENXIO or EINVAL for adding / resizing partitions, which would
make things more complicated. Or maybe you already have data for that
at hand?

diff --git a/block/ioctl.c b/block/ioctl.c
index 9c73a763ef8838..f2028e39767821 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -21,7 +21,7 @@ static int blkpg_do_ioctl(struct block_device *bdev,
sector_t start, length;

if (disk->flags & GENHD_FL_NO_PART)
- return -EINVAL;
+ return -ENXIO;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (copy_from_user(&p, upart, sizeof(struct blkpg_partition)))
\
 
 \ /
  Last update: 2024-01-16 11:49    [W:0.040 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site