From patchwork Wed Jan 6 07:23:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7965141 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23AAFBEEE5 for ; Wed, 6 Jan 2016 07:24:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CA1F201EC for ; Wed, 6 Jan 2016 07:24:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EB9C201E4 for ; Wed, 6 Jan 2016 07:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752378AbcAFHX4 (ORCPT ); Wed, 6 Jan 2016 02:23:56 -0500 Received: from mga09.intel.com ([134.134.136.24]:51842 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbcAFHXy (ORCPT ); Wed, 6 Jan 2016 02:23:54 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 05 Jan 2016 23:23:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,528,1444719600"; d="scan'208";a="24383337" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.136]) by fmsmga004.fm.intel.com with ESMTP; 05 Jan 2016 23:23:33 -0800 Subject: [PATCH 4/9] block, dax: disable dax in the presence of bad blocks From: Dan Williams To: linux-nvdimm@lists.01.org Cc: linux-block@vger.kernel.org, vishal.l.verma@intel.com, x86@kernel.org Date: Tue, 05 Jan 2016 23:23:07 -0800 Message-ID: <20160106072307.40900.65804.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20160106072246.40900.8851.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20160106072246.40900.8851.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- block/ioctl.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }