linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] block drivers + dax vs driver unbind
@ 2015-09-30  0:41 Dan Williams
  2015-09-30  0:41 ` [PATCH 1/2] block: generic request_queue reference counting Dan Williams
  2015-09-30  0:41 ` [PATCH 2/2] block, dax: fix lifetime of in-kernel dax mappings Dan Williams
  0 siblings, 2 replies; 13+ messages in thread
From: Dan Williams @ 2015-09-30  0:41 UTC (permalink / raw)
  To: axboe
  Cc: Boaz Harrosh, linux-nvdimm, Dave Chinner, linux-kernel,
	Keith Busch, ross.zwisler, Christoph Hellwig

Auditing pmem driver teardown operations, while developing
get_user_pages() support for dax [1], revealed that we can trivially
crash the kernel by triggering new i/o requests after unbinding the pmem
driver.  In fact, any bio-based driver is susceptible to this crash
because the queue draining done at shutdown uses in flight 'struct
request' objects to pin the queue active.

Solve the problem generically for all drivers and export the new
blk_queue_enter() and blk_queue_exit() helpers for dax to indicate when
the "request queue" is busy (i.e. we are actively using an address
returned by ->direct_access()).

[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-September/002199.html

---

Dan Williams (2):
      block: generic request_queue reference counting
      block, dax: fix lifetime of in-kernel dax mappings


 block/blk-core.c       |   71 +++++++++++++++++++++++---
 block/blk-mq-sysfs.c   |    6 --
 block/blk-mq.c         |   80 +++++++++---------------------
 block/blk-sysfs.c      |    3 -
 block/blk.h            |   12 ++++
 fs/dax.c               |  130 +++++++++++++++++++++++++++++++-----------------
 include/linux/blk-mq.h |    1 
 include/linux/blkdev.h |    4 +
 8 files changed, 185 insertions(+), 122 deletions(-)

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

end of thread, other threads:[~2015-10-06 21:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-30  0:41 [PATCH 0/2] block drivers + dax vs driver unbind Dan Williams
2015-09-30  0:41 ` [PATCH 1/2] block: generic request_queue reference counting Dan Williams
2015-10-04  6:40   ` Christoph Hellwig
2015-10-05 23:44     ` Dan Williams
2015-10-04  7:52   ` Ming Lei
2015-10-05 23:23     ` Dan Williams
2015-10-06 10:46       ` Ming Lei
2015-10-06 16:04         ` Dan Williams
2015-09-30  0:41 ` [PATCH 2/2] block, dax: fix lifetime of in-kernel dax mappings Dan Williams
2015-09-30 23:35   ` Dave Chinner
2015-10-01  0:09     ` Dan Williams
2015-10-06  1:57     ` Dan Williams
2015-10-06 21:15       ` Dave Chinner

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