linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org, jane.chu@oracle.com,
	willy@infradead.org, tytso@mit.edu, linux-ext4@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, sandeen@sandeen.net
Subject: Re: [PATCHSET 0/2] dax: fix broken pmem poison narrative
Date: Tue, 17 Aug 2021 08:46:01 -0700	[thread overview]
Message-ID: <20210817154601.GD12640@magnolia> (raw)
In-Reply-To: <YRtnlPERHfMZ23Tr@infradead.org>

On Tue, Aug 17, 2021 at 08:39:00AM +0100, Christoph Hellwig wrote:
> On Mon, Aug 16, 2021 at 02:05:18PM -0700, Darrick J. Wong wrote:
> > AFAICT, the only reason why the "punch and write" dance works at all is
> > that the XFS and ext4 currently call blkdev_issue_zeroout when
> > allocating pmem as part of a pwrite call.  A pwrite without the punch
> > won't clear the poison, because pwrite on a DAX file calls
> > dax_direct_access to access the memory directly, and dax_direct_access
> > is only smart enough to bail out on poisoned pmem.  It does not know how
> > to clear it.  Userspace could solve the problem by calling FIEMAP and
> > issuing a BLKZEROOUT, but that requires rawio capabilities.
> > 
> > The whole pmem poison recovery story is is wrong and needs to be
> > corrected ASAP before everyone else starts doing this.  Therefore,
> > create a dax_zeroinit_range function that filesystems can call to reset
> > the contents of the pmem to a known value and clear any state associated
> > with the media error.  Then, connect FALLOC_FL_ZERO_RANGE to this new
> > function (for DAX files) so that unprivileged userspace has a safe way
> > to reset the pmem and clear media errors.
> 
> I agree with the problem statement, but I don't think the fix is
> significantly better than what we have, as it still magically overloads
> other behavior.  I'd rather have an explicit operation to clear the
> poison both at the syscall level (maybe another falloc mode), and the
> internal kernel API level (new method in dax_operations).

I've long wondered why we can't just pass a write flag to the
direct_access functions so that pmem_dax_direct_access can clear the
poison.  Then we ought to be able to tell userspace that they can
recover from write errors by pwrite() or triggering a write fault on the
page, I think.  That's how userspace recovers from IO errors on
traditional disks; I've never understood why it has to be any different
now.

> Also for the next iteration please split the iomap changes from the
> usage in xfs.

ok.

--D

  reply	other threads:[~2021-08-17 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 21:05 [PATCHSET 0/2] dax: fix broken pmem poison narrative Darrick J. Wong
2021-08-16 21:05 ` [PATCH 1/2] xfs: use DAX block device zeroout for FSDAX file ZERO_RANGE operations Darrick J. Wong
2021-08-16 21:05 ` [PATCH 2/2] ext4: " Darrick J. Wong
2021-08-16 21:14 ` [PATCHSET 0/2] dax: fix broken pmem poison narrative Darrick J. Wong
2021-08-17  7:39 ` Christoph Hellwig
2021-08-17 15:46   ` Darrick J. Wong [this message]
2021-08-24 19:25   ` 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=20210817154601.GD12640@magnolia \
    --to=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=jane.chu@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    --cc=tytso@mit.edu \
    --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).