Re: [PATCH] xfs: return errors from partial I/O failures to files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 27, 2015 at 09:41:52AM -0400, David Jeffery wrote:
> On 08/26/2015 06:19 PM, Dave Chinner wrote:
> >> index 3859f5e..b82b128 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 (!test_bit(BIO_UPTODATE, &bio->bi_flags))
> >> +		ioend->io_error = error;
> > 
> > We should preserve the original error that was reported, rather than
> > report the last one. ioend->io_error is always initialised to zero,
> > so we can simply do:
> 
> Is there a particular reason to prefer the first error?  Is it just
> standard practice?  I originally made a version which preserved the
> first error but couldn't think of a reason why the first or last would
> be best.  So I went with the patch which has the simpler if statement.

Standard practice in XFS - it's the first error that matters in most
cases. Subsequent errors are usually less meaningful as they are
either a result of the first error (i.e. cascading hardware errors),
tainted by the first error (e.g. first IO completion error shuts
down the fs, second IO completion error caused by the detection of a
shut down filesystem) or just unrelated noise....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux