aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_buf.c
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2007-05-14 04:24:23 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 02:23:45 -0400
commit0bfefc46dc028df60120acdb92062169c9328769 (patch)
treece8cecb3f4546300c0d193efa27bf14f78170b3b /fs/xfs/linux-2.6/xfs_buf.c
parentc1561cf463f4a480d1960e833c8fe628207b24e4 (diff)
[XFS] Barriers need to be dynamically checked and switched off
If the underlying block device suddenly stops supporting barriers, we need to handle the -EOPNOTSUPP error in a sane manner rather than shutting down the filesystem. If we get this error, clear the barrier flag, reissue the I/O, and tell the world bad things are occurring. SGI-PV: 964544 SGI-Modid: xfs-linux-melb:xfs-kern:28568a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index b0f0e58866de..8d9298c99763 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -997,7 +997,18 @@ xfs_buf_iodone_work(
997 xfs_buf_t *bp = 997 xfs_buf_t *bp =
998 container_of(work, xfs_buf_t, b_iodone_work); 998 container_of(work, xfs_buf_t, b_iodone_work);
999 999
1000 if (bp->b_iodone) 1000 /*
1001 * We can get an EOPNOTSUPP to ordered writes. Here we clear the
1002 * ordered flag and reissue them. Because we can't tell the higher
1003 * layers directly that they should not issue ordered I/O anymore, they
1004 * need to check if the ordered flag was cleared during I/O completion.
1005 */
1006 if ((bp->b_error == EOPNOTSUPP) &&
1007 (bp->b_flags & (XBF_ORDERED|XBF_ASYNC)) == (XBF_ORDERED|XBF_ASYNC)) {
1008 XB_TRACE(bp, "ordered_retry", bp->b_iodone);
1009 bp->b_flags &= ~XBF_ORDERED;
1010 xfs_buf_iorequest(bp);
1011 } else if (bp->b_iodone)
1001 (*(bp->b_iodone))(bp); 1012 (*(bp->b_iodone))(bp);
1002 else if (bp->b_flags & XBF_ASYNC) 1013 else if (bp->b_flags & XBF_ASYNC)
1003 xfs_buf_relse(bp); 1014 xfs_buf_relse(bp);