All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: PROBLEM: BLKPG_DEL_PARTITION with GENHD_FL_NO_PART used to return ENXIO, now returns EINVAL
Date: Tue, 16 Jan 2024 02:47:14 -0800	[thread overview]
Message-ID: <ZaZesiKpbMEiiTrf@infradead.org> (raw)
In-Reply-To: <CAOYeF9VsmqKMcQjo1k6YkGNujwN-nzfxY17N3F-CMikE1tYp+w@mail.gmail.com>

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)))

  parent reply	other threads:[~2024-01-16 10:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 12:13 PROBLEM: BLKPG_DEL_PARTITION with GENHD_FL_NO_PART used to return ENXIO, now returns EINVAL Allison Karlitskaya
2024-01-15 12:57 ` Karel Zak
2024-01-15 14:25   ` Jens Axboe
2024-01-16 10:47 ` Christoph Hellwig [this message]
2024-01-16 13:03   ` Allison Karlitskaya
2024-01-16 13:23   ` Yu Kuai
2024-01-16 13:46     ` Yu Kuai
2024-01-17 18:34       ` Christoph Hellwig
2024-01-17 23:05       ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZaZesiKpbMEiiTrf@infradead.org \
    --to=hch@infradead.org \
    --cc=allison.karlitskaya@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.