linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, "Ewan D . Milne" <emilne@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 0/3] block: avoid to drop & re-add partitions if partitions aren't changed
Date: Wed, 24 Feb 2021 17:14:02 +0100	[thread overview]
Message-ID: <20210224161402.GB9127@lst.de> (raw)
In-Reply-To: <YDY3SqyNTeiYMdpG@T590>

On Wed, Feb 24, 2021 at 07:23:54PM +0800, Ming Lei wrote:
> > > The two patches changes block ioctl(BLKRRPART) for avoiding drop &
> > > re-add partitions if partitions state isn't changed. The current
> > > behavior confuses userspace because partitions can disappear anytime
> > > when calling into ioctl(BLKRRPART).
> > 
> > Which is the f***king point of BLKRRPART and the behavior it had
> > since day 1.  Please fix the application(s) that all it all the time
> > instead of bloating the kernel, as said before.
> > 
> 
> ioctl(BLKRRPART) can be called without changing partition table in
> fdisk, cfdisk, sfdisk, systemd and blockdev at least, and it isn't only
> on one single application. Even for blockdev, not sure if it can be fixed
> because '--rereadpt' is simply one subcommand.

I can also do all kinds of other bad things when I really want to.  So
if a privileged user uses *fdisk, or explicitly calls
blockdev --rereadpt, we can expect this behavior, and all of them above
should not be frequent.

It seems like the main culprit is systemd, so please look into what is
going wrong there.

      reply	other threads:[~2021-02-24 16:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  3:58 [PATCH V2 0/3] block: avoid to drop & re-add partitions if partitions aren't changed Ming Lei
2021-02-24  3:58 ` [PATCH V2 1/4] block: define parsed_partitions.flags as 'unsigned char' Ming Lei
2021-02-24  4:32   ` Chaitanya Kulkarni
2021-02-24  3:58 ` [PATCH V2 2/4] block: store partition flags into block_device Ming Lei
2021-02-24  3:58 ` [PATCH V2 3/4] block: re-organize blk_add_partitions Ming Lei
2021-02-24  3:58 ` [PATCH V2 4/4] block: avoid to drop & re-add partitions if partitions aren't changed Ming Lei
2021-02-24  8:18 ` [PATCH V2 0/3] " Christoph Hellwig
2021-02-24 11:23   ` Ming Lei
2021-02-24 16:14     ` Christoph Hellwig [this message]

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=20210224161402.GB9127@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=emilne@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).