If the underlying protocal doesn't support retry and there are some transient errors happening somewhere in our IO stack, we'd like to give an extra chance for IO. Or sometimes you see btrfs reporting 'wrr 1 flush 0 read 0 blabla' but the disk drive is 100% good, this retry may help a bit.
In btrfs, read retry is handled in bio_readpage_error() with the retry unit being page size, for write retry however, we're going to do it in a different way, as a write may consist of several writes onto different stripes, retry write needs to be done right after the IO on each stripe completes and arrives at endio. Patch 1-3 are the implementation of retry write on error for non-raid56 profile. Patch 4-6 are for raid56 profile. Both raid56 and non-raid56 shares one retry function helper. Patch 3 does retry sector by sector, but since this patch set doesn't included badblocks support, patch 7 changes it back to retry the whole bio. (I didn't fold patch 7 to patch 3 in the hope of just reverting patch 7 once badblocks support is done, but I'm open to it.) Liu Bo (7): Btrfs: keep a copy of bi_iter in btrfs_io_bio Btrfs: add helper __btrfs_end_bio Btrfs: retry write for non-raid56 Btrfs: get rbio inside fail_bio_stripe Btrfs: add helper __raid_write_end_io Btrfs: retry write for raid56 Btrfs: retry the whole bio on write error fs/btrfs/extent_io.c | 2 - fs/btrfs/raid56.c | 73 ++++++++++++++++++++++------ fs/btrfs/volumes.c | 133 ++++++++++++++++++++++++++++++++++++++++----------- fs/btrfs/volumes.h | 3 ++ 4 files changed, 167 insertions(+), 44 deletions(-) -- 2.9.4 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html