From: Mark Tinguely <tinguely@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/3] xfs: fix broken error handling in xfs_vm_writepage
Date: Tue, 13 Nov 2012 08:27:34 -0600 [thread overview]
Message-ID: <50A258D6.8070606@sgi.com> (raw)
In-Reply-To: <1352718586-3538-3-git-send-email-david@fromorbit.com>
On 11/12/12 05:09, Dave Chinner wrote:
> From: Dave Chinner<dchinner@redhat.com>
>
> When we shut down the filesystem, it might first be detected in
> writeback when we are allocating a inode size transaction. This
> happens after we have moved all the pages into the writeback state
> and unlocked them. Unfortunately, if we fail to set up the
> transaction we then abort writeback and try to invalidate the
> current page. This then triggers are BUG() in block_invalidatepage()
> because we are trying to invalidate an unlocked page.
>
> Fixing this is a bit of a chicken and egg problem - we can't
> allocate the transaction until we've clustered all the pages into
> the IO and we know the size of it (i.e. whether the last block of
> the IO is beyond the current EOF or not). However, we don't want to
> hold pages locked for long periods of time, especially while we lock
> other pages to cluster them into the write.
>
> To fix this, we need to make a clear delineation in writeback where
> errors can only be handled by IO completion processing. That is,
> once we have marked a page for writeback and unlocked it, we have to
> report errors via IO completion because we've already started the
> IO. We may not have submitted any IO, but we've changed the page
> state to indicate that it is under IO so we must now use the IO
> completion path to report errors.
>
> To do this, add an error field to xfs_submit_ioend() to pass it the
> error that occurred during the building on the ioend chain. When
> this is non-zero, mark each ioend with the error and call
> xfs_finish_ioend() directly rather than building bios. This will
> immediately push the ioends through completion processing with the
> error that has occurred.
>
> Signed-off-by: Dave Chinner<dchinner@redhat.com>
> ---
I could not recreate the problem with my test machines, which is not
surprising - it is a matter of timing.
The patch looks sound to me.
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-11-13 14:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-12 11:09 [PATCH 0/3] xfs: fixes for 3.7-rc6 Dave Chinner
2012-11-12 11:09 ` [PATCH 1/3] xfs: fix attr tree double split corruption Dave Chinner
2012-11-12 19:10 ` Mark Tinguely
2012-11-12 11:09 ` [PATCH 2/3] xfs: fix broken error handling in xfs_vm_writepage Dave Chinner
2012-11-13 14:27 ` Mark Tinguely [this message]
2012-11-12 11:09 ` [PATCH 3/3] xfs: drop buffer io reference when a bad bio is built Dave Chinner
2012-11-12 20:51 ` Mark Tinguely
2012-11-13 2:01 ` [PATCH 0/3] xfs: fixes for 3.7-rc6 Ben Myers
2012-11-13 3:05 ` Dave Chinner
2012-11-13 7:11 ` Christoph Hellwig
2012-11-13 19:46 ` Dave Chinner
2012-11-13 21:20 ` Ben Myers
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=50A258D6.8070606@sgi.com \
--to=tinguely@sgi.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.