From: Christoph Hellwig <hch@infradead.org>
To: Jane Chu <jane.chu@oracle.com>
Cc: david@fromorbit.com, djwong@kernel.org, dan.j.williams@intel.com,
hch@infradead.org, vishal.l.verma@intel.com,
dave.jiang@intel.com, agk@redhat.com, snitzer@redhat.com,
dm-devel@redhat.com, ira.weiny@intel.com, willy@infradead.org,
vgoyal@redhat.com, linux-fsdevel@vger.kernel.org,
nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery
Date: Mon, 8 Nov 2021 23:27:20 -0800 [thread overview]
Message-ID: <YYoi2JiwTtmxONvB@infradead.org> (raw)
In-Reply-To: <20211106011638.2613039-3-jane.chu@oracle.com>
On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote:
> static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff,
> void *addr, size_t bytes, struct iov_iter *i, int mode)
> {
> + phys_addr_t pmem_off;
> + size_t len, lead_off;
> + struct pmem_device *pmem = dax_get_private(dax_dev);
> + struct device *dev = pmem->bb.dev;
> +
> + if (unlikely(mode == DAX_OP_RECOVERY)) {
> + lead_off = (unsigned long)addr & ~PAGE_MASK;
> + len = PFN_PHYS(PFN_UP(lead_off + bytes));
> + if (is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, len)) {
> + if (lead_off || !(PAGE_ALIGNED(bytes))) {
> + dev_warn(dev, "Found poison, but addr(%p) and/or bytes(%#lx) not page aligned\n",
> + addr, bytes);
> + return (size_t) -EIO;
> + }
> + pmem_off = PFN_PHYS(pgoff) + pmem->data_offset;
> + if (pmem_clear_poison(pmem, pmem_off, bytes) !=
> + BLK_STS_OK)
> + return (size_t) -EIO;
> + }
> + }
This is in the wrong spot. As seen in my WIP series individual drivers
really should not hook into copying to and from the iter, because it
really is just one way to write to a nvdimm. How would dm-writecache
clear the errors with this scheme?
So IMHO going back to the separate recovery method as in your previous
patch really is the way to go. If/when the 64-bit store happens we
need to figure out a good way to clear the bad block list for that.
next prev parent reply other threads:[~2021-11-09 7:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-06 1:16 [PATCH v2 0/2] Dax poison recovery Jane Chu
2021-11-06 1:16 ` [PATCH v2 1/2] dax: Introduce normal and recovery dax operation modes Jane Chu
2021-11-06 1:50 ` Darrick J. Wong
2021-11-08 20:43 ` Jane Chu
2021-11-06 16:48 ` Dan Williams
2021-11-08 21:02 ` Jane Chu
2021-11-09 5:26 ` Ira Weiny
2021-11-09 6:04 ` Dan Williams
2021-11-06 1:16 ` [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery Jane Chu
2021-11-06 2:04 ` Darrick J. Wong
2021-11-08 20:53 ` Jane Chu
2021-11-08 21:00 ` Jane Chu
2021-11-09 7:27 ` Christoph Hellwig [this message]
2021-11-09 18:48 ` Dan Williams
2021-11-09 19:52 ` Christoph Hellwig
2021-11-09 19:58 ` Jane Chu
2021-11-09 21:02 ` Dan Williams
2021-11-10 18:26 ` Jane Chu
2021-11-12 15:36 ` Mike Snitzer
2021-11-12 18:00 ` Jane Chu
2021-11-09 19:14 ` Jane Chu
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=YYoi2JiwTtmxONvB@infradead.org \
--to=hch@infradead.org \
--cc=agk@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=dm-devel@redhat.com \
--cc=ira.weiny@intel.com \
--cc=jane.chu@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=snitzer@redhat.com \
--cc=vgoyal@redhat.com \
--cc=vishal.l.verma@intel.com \
--cc=willy@infradead.org \
/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).