diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 50eb603e0cc14477d8d81f3f48014eb02a11a416..82b70bda9f47a51eb3f31a50ae4fcd32f6c57047 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1336,6 +1336,12 @@ _xfs_buf_ioapply( int size; int i; + /* + * Make sure we capture only current IO errors rather than stale errors + * left over from previous use of the buffer (e.g. failed readahead). + */ + bp->b_error = 0; + if (bp->b_flags & XBF_WRITE) { if (bp->b_flags & XBF_SYNCIO) rw = WRITE_SYNC;