From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: bugzilla-daemon@bugzilla.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [Bug 202053] [xfstests generic/464]: XFS corruption and Assertion failed: 0, file: fs/xfs/xfs_super.c, line: 985
Date: Sun, 6 Jan 2019 08:31:20 +1100 [thread overview]
Message-ID: <20190105213120.GS4205@dastard> (raw)
In-Reply-To: <20190104123217.GA16751@bfoster>
On Fri, Jan 04, 2019 at 07:32:17AM -0500, Brian Foster wrote:
> On Tue, Dec 25, 2018 at 06:10:59AM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> - writepages is in progress on a particular file that has decently sized
> post-eof speculative preallocation
> - writepages gets to the point where it looks up or allocates a new imap
> that includes the preallocation, the allocation/lookup result is
> stored in wpc
> - the file is closed by one process, killing off preallocation, then
> immediately appended to by another, updating the file size by a few
> bytes
> - writepages comes back around to xfs_map_blocks() and trims imap to the
> current size, but imap still includes one block of the original speculative
> prealloc (that was truncated and recreated) because the size increased
> between the time imap was stored and trimmed
I'm betting hole punch can cause similar problems with cached maps
in writepage. I wrote a patch yonks ago to put a generation number
in the extent fork and to store it in the cached map, and to
invalidate the cached map if they didn't match.
> The EOF trim approach is known to be a bandaid and potentially racy, but
> ISTM that this problem can be trivially avoided by moving or adding
> trims of wpc->imap immediately after a new one is cached. I don't
> reproduce the problem so far with a couple such extra calls in place.
>
> Bigger picture, we need some kind of invalidation mechanism similar to
> what we're already doing for dealing with the COW fork in this writeback
> context. I'm not sure the broad semantics used by the COW fork sequence
> counter mechanism is really suitable for the data fork because any
> extent-related change in the fork would cause an invalidation, but I am
> wondering if we could define some subset of less frequent operations for
> the same mechanism to reliably invalidate (e.g., on eofblocks trims, for
> starters).
The patch I had is below - I haven't forward ported it or anything,
just pulled it from my archive to demonstrate what I think we
probably need to be doing here. If we want to limit when it causes
invalidations, then we need probably need to limit which operations
cause the generation number for that inode fork to be bumped.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-01-05 21:31 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-24 7:16 [Bug 202053] New: [xfstests generic/464]: XFS corruption and Assertion failed: 0, file: fs/xfs/xfs_super.c, line: 985 bugzilla-daemon
2018-12-24 7:19 ` [Bug 202053] " bugzilla-daemon
2018-12-24 10:40 ` bugzilla-daemon
2018-12-24 10:43 ` bugzilla-daemon
2018-12-24 10:49 ` bugzilla-daemon
2018-12-25 6:10 ` bugzilla-daemon
2019-01-04 12:32 ` Brian Foster
2019-01-04 12:52 ` Brian Foster
2019-01-05 21:31 ` Dave Chinner [this message]
2019-01-06 21:57 ` Dave Chinner
2019-01-07 14:41 ` Brian Foster
2019-01-07 19:11 ` Brian Foster
2019-01-08 5:55 ` Dave Chinner
2019-01-08 14:57 ` Brian Foster
2019-01-07 14:41 ` Brian Foster
2019-01-08 5:46 ` Dave Chinner
2019-01-08 14:54 ` Brian Foster
2019-01-04 12:40 ` bugzilla-daemon
2019-01-04 12:52 ` bugzilla-daemon
2019-01-05 21:31 ` bugzilla-daemon
2019-01-06 21:57 ` bugzilla-daemon
2019-01-07 2:35 ` bugzilla-daemon
2019-01-07 14:41 ` bugzilla-daemon
2019-01-07 14:41 ` bugzilla-daemon
2019-01-07 19:11 ` bugzilla-daemon
2019-01-08 5:46 ` bugzilla-daemon
2019-01-08 5:55 ` bugzilla-daemon
2019-01-08 14:54 ` bugzilla-daemon
2019-01-08 14:57 ` bugzilla-daemon
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=20190105213120.GS4205@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=bugzilla-daemon@bugzilla.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;
as well as URLs for NNTP newsgroup(s).