diff mbox

[4/9] block, dax: disable dax in the presence of bad blocks

Message ID 20160106072307.40900.65804.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Williams Jan. 6, 2016, 7:23 a.m. UTC
Longer term teach dax to punch "error" holes in mapping requests and
deliver SIGBUS to applications that consume a bad pmem page.  For now,
simply disable the dax performance optimization in the presence of known
errors.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 block/ioctl.c |    9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/block/ioctl.c b/block/ioctl.c
index 7a964d842913..46e8cbe469d8 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -422,6 +422,15 @@  bool blkdev_dax_capable(struct block_device *bdev)
 			|| (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
 		return false;
 
+	/*
+	 * If the device has known bad blocks, force all I/O through the
+	 * driver / page cache.
+	 *
+	 * TODO: support finer grained dax error handling
+	 */
+	if (disk->bb)
+		return false;
+
 	return true;
 }