All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Maxim Levitsky <maximlevitsky@gmail.com>,
	Alex Dubov <oakad@yahoo.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-block@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-mmc@vger.kernel.org
Subject: add a ->free_disk block_device_operation v3
Date: Tue, 15 Feb 2022 10:45:09 +0100	[thread overview]
Message-ID: <20220215094514.3828912-1-hch@lst.de> (raw)

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

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>,
	Alex Dubov <oakad@yahoo.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	linux-mmc@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-block@vger.kernel.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: add a ->free_disk block_device_operation v3
Date: Tue, 15 Feb 2022 10:45:09 +0100	[thread overview]
Message-ID: <20220215094514.3828912-1-hch@lst.de> (raw)

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(-)
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

             reply	other threads:[~2022-02-15  9:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  9:45 Christoph Hellwig [this message]
2022-02-15  9:45 ` add a ->free_disk block_device_operation v3 Christoph Hellwig
2022-02-15  9:45 ` [PATCH 1/5] block: add a ->free_disk method Christoph Hellwig
2022-02-15  9:45   ` Christoph Hellwig
2022-02-15  9:45 ` [PATCH 2/5] memstick/ms_block: simplify refcounting Christoph Hellwig
2022-02-15  9:45   ` Christoph Hellwig
2022-02-15  9:45 ` [PATCH 3/5] memstick/mspro_block: fix handling of read-only devices Christoph Hellwig
2022-02-15  9:45   ` Christoph Hellwig
2022-02-15  9:45 ` [PATCH 4/5] memstick/mspro_block: simplify refcounting Christoph Hellwig
2022-02-15  9:45   ` Christoph Hellwig
2022-02-15  9:45 ` [PATCH 5/5] virtio_blk: " Christoph Hellwig
2022-02-15  9:45   ` Christoph Hellwig
2022-02-17  2:48 ` add a ->free_disk block_device_operation v3 Jens Axboe
2022-02-17  2:48   ` 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=20220215094514.3828912-1-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=jasowang@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=maximlevitsky@gmail.com \
    --cc=mst@redhat.com \
    --cc=oakad@yahoo.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=ulf.hansson@linaro.org \
    --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.