From: Allison Henderson <allison.henderson@xxxxxxxxxx> This patch adds b_alt_retry boolean to xfs_buf. We will use this to enable alternate device retry when the bio completes for single buffer bios. At this time, we do not yet support alternate device retry for multi buffer bio Signed-off-by: Allison Henderson <allison.henderson@xxxxxxxxxx> --- fs/xfs/xfs_buf.c | 8 ++++++++ fs/xfs/xfs_buf.h | 1 + 2 files changed, 9 insertions(+) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 4f5f2ff3f70f..e2683c8e868c 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1409,6 +1409,14 @@ xfs_buf_ioapply_map( flush_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp)); } + + /* + * At the moment, we only support alternate + * device retry on single bio buffers + */ + if (size == 0) + bp->b_alt_retry = true; + submit_bio(bio); if (size) goto next_chunk; diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index b9f5511ea998..989b97a17486 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -198,6 +198,7 @@ typedef struct xfs_buf { int b_last_error; const struct xfs_buf_ops *b_ops; + bool b_alt_retry; /* toggle alt device retry */ } xfs_buf_t; /* Finding and Reading Buffers */ -- 2.17.1