linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: axboe@kernel.dk
Cc: Boaz Harrosh <boaz@plexistor.com>,
	linux-nvdimm@ml01.01.org, Dave Chinner <david@fromorbit.com>,
	linux-kernel@vger.kernel.org, Keith Busch <keith.busch@intel.com>,
	ross.zwisler@linux.intel.com, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 0/2] block drivers + dax vs driver unbind
Date: Tue, 29 Sep 2015 20:41:25 -0400	[thread overview]
Message-ID: <20150930002927.37133.331.stgit@dwillia2-desk3.jf.intel.com> (raw)

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

             reply	other threads:[~2015-09-30  0:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30  0:41 Dan Williams [this message]
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

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=20150930002927.37133.331.stgit@dwillia2-desk3.jf.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=axboe@kernel.dk \
    --cc=boaz@plexistor.com \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=ross.zwisler@linux.intel.com \
    /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 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).