From: Matthew Wilcox <willy@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iomap: Handle I/O errors gracefully in page_mkwrite
Date: Fri, 5 Jun 2020 15:49:49 -0700 [thread overview]
Message-ID: <20200605224949.GK19604@bombadil.infradead.org> (raw)
In-Reply-To: <20200605214841.GF2040@dread.disaster.area>
On Sat, Jun 06, 2020 at 07:48:41AM +1000, Dave Chinner wrote:
> On Fri, Jun 05, 2020 at 05:48:26AM -0700, Matthew Wilcox wrote:
> > ... I don't think that's the interesting path. I mean, that's
> > the submission path, and usually we discover errors in the completion
> > path, not the submission path.
>
> Where in the iomap write IO completion path do we call
> ClearPageUptodate()?
Oh, I misread. You're right, I was looking at the read completion path.
So, this is also inconsistent. We clear PageUptodate on errors we
discover during submission, but not for errors we discover during
completion. That doesn't make sense.
> This comes back to my original, underlying worry about the fragility
> of the page fault path: the page fault path is not even checking for
> PageError during faults, and I'm betting that almost no
> ->page_mkwrite implementation is checking it, either....
I think it's a reasonable assumption that user page tables should never
contain a PTE for a page which is !Uptodate. Otherwise the user can
read stale data.
> > I don't see why it can't be done from the submission path.
> > unmap_mapping_range() calls i_mmap_lock_write(), which is
> > down_write(i_mmap_rwsem) in drag. There might be a lock ordering
> > issue there, although lockdep should find it pretty quickly.
> >
> > The bigger problem is the completion path. We're in softirq context,
> > so that will have to punt to a thread that can take mutexes.
>
> Punt to workqueue if we aren't already in a workqueue context -
> for a lot of writes on XFS we already will be running completion in
> a workqueue context....
Yep.
prev parent reply other threads:[~2020-06-05 22:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 20:23 Matthew Wilcox
2020-06-04 22:57 ` Dave Chinner
2020-06-04 23:05 ` Matthew Wilcox
2020-06-04 23:30 ` Dave Chinner
2020-06-04 23:50 ` Matthew Wilcox
2020-06-05 0:31 ` Dave Chinner
2020-06-05 2:24 ` Matthew Wilcox
2020-06-05 3:07 ` Dave Chinner
2020-06-05 12:48 ` Matthew Wilcox
2020-06-05 16:18 ` Darrick J. Wong
2020-06-05 21:48 ` Dave Chinner
2020-06-05 22:49 ` Matthew Wilcox [this message]
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=20200605224949.GK19604@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.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
all inboxes | Powered by JetHome®