linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* add a ->free_disk block_device_operation v2
@ 2022-02-09  8:21 Christoph Hellwig
  2022-02-09  8:21 ` [PATCH 1/5] block: add a ->free_disk method Christoph Hellwig
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Christoph Hellwig @ 2022-02-09  8:21 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Michael S. Tsirkin, Jason Wang, Paolo Bonzini, Stefan Hajnoczi,
	Maxim Levitsky, Alex Dubov, Ulf Hansson, linux-block,
	virtualization, linux-mmc

Hi Jens,

this series adds a ->free_disk method to struct block_device_operation so that
drivers can defer freeing their disk private data until the gendisk goes away
and don't need to play games with the validity of ->private_data.

This also converts three simple drivers over as example, but eventually I
imagine that all drivers with private data will use it.

Changes since v1:
 - fix a tag_set use after free in virtio_blk

Diffstat:
 block/genhd.c                       |    4 +
 drivers/block/virtio_blk.c          |   74 ++++++++++--------------------------
 drivers/memstick/core/ms_block.c    |   64 +++++++------------------------
 drivers/memstick/core/ms_block.h    |    1 
 drivers/memstick/core/mspro_block.c |   57 ++++-----------------------
 include/linux/blkdev.h              |    1 
 6 files changed, 51 insertions(+), 150 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread
* add a ->free_disk block_device_operation v3
@ 2022-02-15  9:45 Christoph Hellwig
  2022-02-15  9:45 ` [PATCH 5/5] virtio_blk: simplify refcounting Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2022-02-15  9:45 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Michael S. Tsirkin, Jason Wang, Paolo Bonzini, Stefan Hajnoczi,
	Maxim Levitsky, Alex Dubov, Ulf Hansson, linux-block,
	virtualization, linux-mmc

Hi Jens,

this series adds a ->free_disk method to struct block_device_operation so that
drivers can defer freeing their disk private data until the gendisk goes away
and don't need to play games with the validity of ->private_data.

This also converts three simple drivers over as example, but eventually I
imagine that all drivers with private data will use it.

Changes since v2:
 - only call ->free_disk after add_disk has returned to simplify probe error
   handling
Changes since v1:
 - fix a tag_set use after free in virtio_blk

Diffstat:
 block/genhd.c                       |    5 ++
 drivers/block/virtio_blk.c          |   66 +++++++-----------------------------
 drivers/memstick/core/ms_block.c    |   64 ++++++++--------------------------
 drivers/memstick/core/ms_block.h    |    1 
 drivers/memstick/core/mspro_block.c |   57 +++++--------------------------
 include/linux/blkdev.h              |    2 +
 6 files changed, 46 insertions(+), 149 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-15  9:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-09  8:21 add a ->free_disk block_device_operation v2 Christoph Hellwig
2022-02-09  8:21 ` [PATCH 1/5] block: add a ->free_disk method Christoph Hellwig
2022-02-09  8:21 ` [PATCH 2/5] memstick/ms_block: simplify refcounting Christoph Hellwig
2022-02-11  2:35   ` Ming Lei
2022-02-09  8:21 ` [PATCH 3/5] memstick/mspro_block: fix handling of read-only devices Christoph Hellwig
2022-02-09  8:21 ` [PATCH 4/5] memstick/mspro_block: simplify refcounting Christoph Hellwig
2022-02-09  8:21 ` [PATCH 5/5] virtio_blk: " Christoph Hellwig
2022-02-09  8:27   ` Michael S. Tsirkin
2022-02-09  9:38   ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2022-02-15  9:45 add a ->free_disk block_device_operation v3 Christoph Hellwig
2022-02-15  9:45 ` [PATCH 5/5] virtio_blk: simplify refcounting Christoph Hellwig

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