Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621593

Re: [PATCH] libnvdimm: fix btt vs clear poison locking

From Jeff Moyer <jmoyer@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] libnvdimm: fix btt vs clear poison locking
Date 2017-04-11 22:10 +0200
Message-ID <tvagV-3eF-7@gated-at.bofh.it> (permalink)
References <ttIPM-45V-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Dan Williams <dan.j.williams@intel.com> 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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] libnvdimm: fix btt vs clear poison locking Jeff Moyer <jmoyer@redhat.com> - 2017-04-11 22:10 +0200
  Re: [PATCH] libnvdimm: fix btt vs clear poison locking Dan Williams <dan.j.williams@intel.com> - 2017-04-11 22:20 +0200

csiph-web