linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/2] block: fix backing_dev_info lifetime
@ 2017-01-07  1:02 Dan Williams
  2017-01-07  1:02 ` [RFC PATCH v2 1/2] block: fix lifetime of request_queue / backing_dev_info relative to bdev Dan Williams
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dan Williams @ 2017-01-07  1:02 UTC (permalink / raw)
  To: linux-block
  Cc: Andi Kleen, Jan Kara, Rabin Vincent, linux-nvdimm, linux-kernel,
	Jens Axboe, Jeff Moyer, Wei Fang, linux-fsdevel,
	Christoph Hellwig

v1 of these changes [1] was a one line change to bdev_get_queue() to
prevent a shutdown crash when del_gendisk() races the final
__blkdev_put().

While it is known at del_gendisk() time that the queue is still alive,
Jan Kara points to other paths [2] that are racing __blkdev_put() where
the assumption that ->bd_queue, or inode->i_wb is valid does not hold.

Fix that broken assumption, make it the case that if you have a live
block_device, or block_device-inode that the corresponding queue and
inode-write-back data is still valid.

These changes survive a run of the libnvdimm unit test suite which puts
some stress on the block_device shutdown path.

---

Changes since v1 [1]:

* Introduce "block: fix lifetime of request_queue / backing_dev_info
  relative to bdev" to keep the queue allocated and the inode attached
  for writeback until ->destroy_inode() time.

* Rework the comments in "block: fix blk_get_backing_dev_info() crash,
  use bdev->bd_queue" to reflect the assumptions about the liveness of
  ->bd_queue.

[1]: http://marc.info/?l=linux-block&m=148366637105761&w=2
[2]: http://www.spinics.net/lists/linux-fsdevel/msg105153.html

---

Dan Williams (2):
      block: fix lifetime of request_queue / backing_dev_info relative to bdev
      block: fix blk_get_backing_dev_info() crash, use bdev->bd_queue


 block/blk-core.c       |    7 ++++---
 fs/block_dev.c         |   25 +++++++++++++++----------
 include/linux/blkdev.h |    6 +++++-
 include/linux/fs.h     |    1 +
 4 files changed, 25 insertions(+), 14 deletions(-)

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

end of thread, other threads:[~2017-01-26 16:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-07  1:02 [RFC PATCH v2 0/2] block: fix backing_dev_info lifetime Dan Williams
2017-01-07  1:02 ` [RFC PATCH v2 1/2] block: fix lifetime of request_queue / backing_dev_info relative to bdev Dan Williams
2017-01-09  2:39   ` [lkp-developer] [block] 1442488925: WARNING:at_mm/backing-dev.c:#bdi_exit kernel test robot
2017-01-07  1:03 ` [RFC PATCH v2 2/2] block: fix blk_get_backing_dev_info() crash, use bdev->bd_queue Dan Williams
2017-01-23 21:17 ` [RFC PATCH v2 0/2] block: fix backing_dev_info lifetime Thiago Jung Bauermann
2017-01-25 21:43   ` Dan Williams
2017-01-26 10:06     ` Jan Kara
2017-01-26 13:17       ` Christoph Hellwig
2017-01-26 16:39         ` Dan Williams

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