All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bill O'Donnell" <billodo@redhat.com>
To: David Jeffery <djeffery@redhat.com>,
	stable@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH 2/4] xfs: return errors from partial I/O failures to files
Date: Thu, 3 Sep 2015 10:27:57 -0500	[thread overview]
Message-ID: <20150903152757.GA26655@redhat.com> (raw)
In-Reply-To: <1441293986-26474-2-git-send-email-billodo@redhat.com>

please disregard. Mistake with guilt. :(


On Thu, Sep 03, 2015 at 10:26:24AM -0500, billodo wrote:
> From: David Jeffery <djeffery@redhat.com>
> 
> There is an issue with xfs's error reporting in some cases of I/O partially
> failing and partially succeeding. Calls like fsync() can report success even
> though not all I/O was successful in partial-failure cases such as one disk of
> a RAID0 array being offline.
> 
> The issue can occur when there are more than one bio per xfs_ioend struct.
> Each call to xfs_end_bio() for a bio completing will write a value to
> ioend->io_error.  If a successful bio completes after any failed bio, no
> error is reported do to it writing 0 over the error code set by any failed bio.
> The I/O error information is now lost and when the ioend is completed
> only success is reported back up the filesystem stack.
> 
> xfs_end_bio() should only set ioend->io_error in the case of BIO_UPTODATE
> being clear.  ioend->io_error is initialized to 0 at allocation so only needs
> to be updated by a failed bio. Also check that ioend->io_error is 0 so that
> the first error reported will be the error code returned.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: David Jeffery <djeffery@redhat.com>
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
> Signed-off-by: Dave Chinner <david@fromorbit.com>
> Signed-off-by: billodo <billodo@redhat.com>
> ---
>  fs/xfs/xfs_aops.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 3859f5e..458fced 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -356,7 +356,8 @@ xfs_end_bio(
>  {
>  	xfs_ioend_t		*ioend = bio->bi_private;
>  
> -	ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error;
> +	if (!ioend->io_error && !test_bit(BIO_UPTODATE, &bio->bi_flags))
> +		ioend->io_error = error;
>  
>  	/* Toss bio and pass work off to an xfsdatad thread */
>  	bio->bi_private = NULL;
> -- 
> 2.4.3
> 

      reply	other threads:[~2015-09-03 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 15:26 [PATCH 2/4] xfs: return errors from partial I/O failures to files billodo
2015-09-03 15:27 ` Bill O'Donnell [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=20150903152757.GA26655@redhat.com \
    --to=billodo@redhat.com \
    --cc=david@fromorbit.com \
    --cc=djeffery@redhat.com \
    --cc=stable@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 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.