Files
android_kernel_xiaomi_sm8450/fs/xfs
David Jeffery c9eb256eda xfs: return errors from partial I/O failures to files
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>
2015-08-28 14:50:45 +10:00
..
2014-07-30 09:12:05 +10:00
2015-02-16 11:49:23 +11:00
2013-05-07 18:45:36 -05:00
2011-08-12 16:21:35 -05:00
2012-11-19 20:11:24 -06:00
2013-08-12 16:53:39 -05:00
2011-08-12 16:21:35 -05:00
2015-06-22 09:44:02 +10:00
2015-06-22 09:44:02 +10:00
2011-08-12 16:21:35 -05:00
2013-08-12 16:56:06 -05:00
2015-06-22 09:45:10 +10:00
2015-06-04 13:48:20 +10:00
2015-06-04 13:48:20 +10:00
2013-05-07 18:45:36 -05:00
2015-06-04 13:48:08 +10:00
2015-03-04 16:06:38 +01:00
2015-06-04 09:19:18 +10:00
2015-02-23 21:22:31 +11:00
2015-01-09 10:47:43 +11:00
2014-09-09 11:52:42 +10:00
2015-06-04 13:48:20 +10:00
2013-05-07 18:45:36 -05:00