All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Yury Kamenev <damtev@yandex-team.ru>,
	mst@redhat.com, jasowang@redhat.com, pbonzini@redhat.com,
	axboe@kernel.dk, virtualization@lists.linux-foundation.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mmc@vger.kernel.org, Lauri Kasanen <cand@gmx.com>
Subject: Re: [PATCH 1/1] virtio: disable partitions scanning for no partitions block
Date: Mon, 24 May 2021 16:56:54 +0200	[thread overview]
Message-ID: <20210524145654.GA2632@lst.de> (raw)
In-Reply-To: <YKu4Qovv1KMplifY@stefanha-x1.localdomain>

On Mon, May 24, 2021 at 03:29:22PM +0100, Stefan Hajnoczi wrote:
> GENHD_FL_NO_PART_SCAN is not used much in other drivers. This makes me
> wonder if the same use case is addressed through other means with SCSI,
> NVMe, etc devices. Maybe Christoph or Jens can weigh in on whether
> adding a bit to disable partition scanning for a virtio-blk fits into
> the big picture?
> 
> Is your goal to avoid accidentally detecting partitions because it's
> confusing when that happens?

I'm really confused what the use case is here.  GENHD_FL_NO_PART_SCAN
has four users:

 - the block core setting it for hidden devices, for which the concept
   of paritions doesn't make sense.  Looking back this should have never
   used GENHD_FL_NO_PART_SCAN, and instead the partition scanning code
   should just check GENHD_FL_HIDDEN as well.
 - mmc uses it for boot partitions and rpmb.  I'm not even sure how
   these can be exposed as block devices as they don't require block
   granularity access IIRC, but if the allow block layer access there
   is no reason to ever set these flags.
 - loop is a bit of a mess.  IIRC the story is that originally the
   loop device did not support partitions, then in 2008 support for
   partitions was added by partitioning the minor number space, and
   then in 2011 support for partitions without that parameter was
   added using a new flag in the loop device creation ioctl that uses
   the extended dev_t space added since.  But even that might be
   something we can handled without that flag without breaking the
   userspace ABI
 - m64card sets it for no good reason at all

In other words: in a perfect would GENHD_FL_NO_PART_SCAN would not
exist, and it certainly should not be added to a new driver, never
mind a protocol.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Yury Kamenev <damtev@yandex-team.ru>,
	axboe@kernel.dk, mst@redhat.com, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-block@vger.kernel.org, pbonzini@redhat.com,
	Lauri Kasanen <cand@gmx.com>
Subject: Re: [PATCH 1/1] virtio: disable partitions scanning for no partitions block
Date: Mon, 24 May 2021 16:56:54 +0200	[thread overview]
Message-ID: <20210524145654.GA2632@lst.de> (raw)
In-Reply-To: <YKu4Qovv1KMplifY@stefanha-x1.localdomain>

On Mon, May 24, 2021 at 03:29:22PM +0100, Stefan Hajnoczi wrote:
> GENHD_FL_NO_PART_SCAN is not used much in other drivers. This makes me
> wonder if the same use case is addressed through other means with SCSI,
> NVMe, etc devices. Maybe Christoph or Jens can weigh in on whether
> adding a bit to disable partition scanning for a virtio-blk fits into
> the big picture?
> 
> Is your goal to avoid accidentally detecting partitions because it's
> confusing when that happens?

I'm really confused what the use case is here.  GENHD_FL_NO_PART_SCAN
has four users:

 - the block core setting it for hidden devices, for which the concept
   of paritions doesn't make sense.  Looking back this should have never
   used GENHD_FL_NO_PART_SCAN, and instead the partition scanning code
   should just check GENHD_FL_HIDDEN as well.
 - mmc uses it for boot partitions and rpmb.  I'm not even sure how
   these can be exposed as block devices as they don't require block
   granularity access IIRC, but if the allow block layer access there
   is no reason to ever set these flags.
 - loop is a bit of a mess.  IIRC the story is that originally the
   loop device did not support partitions, then in 2008 support for
   partitions was added by partitioning the minor number space, and
   then in 2011 support for partitions without that parameter was
   added using a new flag in the loop device creation ioctl that uses
   the extended dev_t space added since.  But even that might be
   something we can handled without that flag without breaking the
   userspace ABI
 - m64card sets it for no good reason at all

In other words: in a perfect would GENHD_FL_NO_PART_SCAN would not
exist, and it certainly should not be added to a new driver, never
mind a protocol.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-05-24 15:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 13:39 [PATCH 0/1] virtio: disable partitions scanning for no partitions block Yury Kamenev
2021-05-20 13:39 ` [PATCH 1/1] " Yury Kamenev
2021-05-24 14:29   ` Stefan Hajnoczi
2021-05-24 14:29     ` Stefan Hajnoczi
2021-05-24 14:56     ` Christoph Hellwig [this message]
2021-05-24 14:56       ` Christoph Hellwig
2021-05-24 16:25       ` Ulf Hansson
2021-05-24 16:25         ` Ulf Hansson
     [not found]     ` <90021621883891@mail.yandex-team.ru>
2021-05-24 19:41       ` Paolo Bonzini
2021-05-24 19:41         ` Paolo Bonzini
2021-05-25 12:00         ` Iurii Kamenev
  -- strict thread matches above, loose matches on Subject: below --
2021-07-15  9:47 [PATCH 0/1] " Yury Kamenev
2021-07-15  9:47 ` [PATCH 1/1] " Yury Kamenev
2021-07-15 11:22   ` Paolo Bonzini
2021-07-15 11:22     ` Paolo Bonzini
2021-07-16  1:09   ` kernel test robot
2021-07-16  1:09     ` kernel test robot
2021-07-16  1:09     ` kernel test robot
2021-07-16  2:57   ` Jason Wang
2021-07-16  2:57     ` Jason Wang
2021-05-20 13:36 [PATCH 0/1] " Yury Kamenev
2021-05-20 13:36 ` [PATCH 1/1] " Yury Kamenev

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=20210524145654.GA2632@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=cand@gmx.com \
    --cc=damtev@yandex-team.ru \
    --cc=jasowang@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.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.