linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Ewan D . Milne" <emilne@redhat.com>
Subject: Re: [PATCH 2/2] block: avoid to drop & re-add partitions if partitions aren't changed
Date: Fri, 5 Feb 2021 15:30:07 +0800	[thread overview]
Message-ID: <20210205073007.GA1519884@T590> (raw)
In-Reply-To: <20210205071429.GA28033@lst.de>

On Fri, Feb 05, 2021 at 08:14:29AM +0100, Christoph Hellwig wrote:
> On Fri, Feb 05, 2021 at 10:17:08AM +0800, Ming Lei wrote:
> > block ioctl(BLKRRPART) always drops current partitions and adds
> > partitions again, even though there isn't any change in partitions table.
> > 
> > ioctl(BLKRRPART) may be called by systemd-udevd and some disk utilities
> > frequently.
> 
> Err, why?  We should probably fix udev to not do stupid things first.

It is one standard syscall, and the command is just for re-read
partition table, and it can be called by any application, fdisk
calls it too even though no any change done on the disk data,
same with parted, and there should be more.

	#define BLKRRPART  _IO(0x12,95) /* re-read partition table */

IMO, this syscall isn't supposed to drop partitions if user doesn't
touch the partition table, do you think it is one sane behavior to
drop partitions at will?

-- 
Ming


  reply	other threads:[~2021-02-05  7:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05  2:17 [PATCH 0/2] block: avoid to drop & re-add partitions if partitions aren't changed Ming Lei
2021-02-05  2:17 ` [PATCH 1/2] block: move partitions check code into single helper Ming Lei
2021-02-05  2:17 ` [PATCH 2/2] block: avoid to drop & re-add partitions if partitions aren't changed Ming Lei
2021-02-05  7:14   ` Christoph Hellwig
2021-02-05  7:30     ` Ming Lei [this message]
2021-02-15  4:03 ` [PATCH 0/2] " Ming Lei
2021-02-16  8:44   ` Christoph Hellwig
2021-02-17  3:07     ` Ming Lei
2021-02-17  7:16       ` Christoph Hellwig
2021-02-18  7:57         ` Ming Lei

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=20210205073007.GA1519884@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=emilne@redhat.com \
    --cc=hch@lst.de \
    --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 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).