From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753430AbdDKUIm (ORCPT ); Tue, 11 Apr 2017 16:08:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55482 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbdDKUIj (ORCPT ); Tue, 11 Apr 2017 16:08:39 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 10A1FC059725 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jmoyer@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 10A1FC059725 From: Jeff Moyer To: Dan Williams Cc: linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] libnvdimm: fix btt vs clear poison locking References: <149159694856.26101.16830021017958812113.stgit@dwillia2-desk3.amr.corp.intel.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Tue, 11 Apr 2017 16:08:37 -0400 In-Reply-To: <149159694856.26101.16830021017958812113.stgit@dwillia2-desk3.amr.corp.intel.com> (Dan Williams's message of "Fri, 07 Apr 2017 13:29:08 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 11 Apr 2017 20:08:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Williams writes: > As a minimal fix, disable error clearing when the BTT is enabled. For > the final fix a larger rework of the poison list locking is needed. > @@ -243,7 +243,15 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, > } > > if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) { > - if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) { > + /* > + * FIXME: nsio_rw_bytes() may be called from atomic > + * context in the BTT case and nvdimm_clear_poison() > + * takes a sleeping lock. Until the locking can be > + * reworked this capability depends on !BTT or BROKEN. > + */ > + if ((!IS_ENABLED(CONFIG_BTT) || IS_ENABLED(CONFIG_BROKEN)) > + && IS_ALIGNED(offset, 512) > + && IS_ALIGNED(size, 512)) { I don't like that you've disabled clear error just because the btt driver was enabled. Can't you do something like this, instead? disable_clear_poison = (ndns->claim && is_nd_btt(ndns->claim)); if (!disable_clear_poison && IS_ALIGNED(offset, 512)... -Jeff