summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf_item.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-04-23 15:58:38 +1000
committerBen Myers <bpm@sgi.com>2012-05-14 16:20:30 -0500
commit960c60af8b9481595e68875e79b2602e73169c29 (patch)
tree26756622c5a0c63ead727621602cc1670604c0a3 /fs/xfs/xfs_buf_item.c
parentfe7257fd4b8ae9a3e354d9edb61890973e373ef0 (diff)
xfs: do not add buffers to the delwri queue until pushed
Instead of adding buffers to the delwri list as soon as they are logged, even if they can't be written until commited because they are pinned defer adding them to the delwri list until xfsaild pushes them. This makes the code more similar to other log items and prepares for writing buffers directly from xfsaild. The complication here is that we need to fail buffers that were added but not logged yet in xfs_buf_item_unpin, borrowing code from xfs_bioerror. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf_item.c')
-rw-r--r--fs/xfs/xfs_buf_item.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index eac97ef81e2..3a0bc38f185 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -460,6 +460,12 @@ xfs_buf_item_unpin(
ASSERT(bp->b_fspriv == NULL);
}
xfs_buf_relse(bp);
+ } else if (freed && remove) {
+ xfs_buf_lock(bp);
+ xfs_buf_ioerror(bp, EIO);
+ XFS_BUF_UNDONE(bp);
+ xfs_buf_stale(bp);
+ xfs_buf_ioend(bp, 0);
}
}
@@ -604,9 +610,7 @@ xfs_buf_item_committed(
}
/*
- * The buffer is locked, but is not a delayed write buffer. This happens
- * if we race with IO completion and hence we don't want to try to write it
- * again. Just release the buffer.
+ * The buffer is locked, but is not a delayed write buffer.
*/
STATIC void
xfs_buf_item_push(
@@ -620,6 +624,7 @@ xfs_buf_item_push(
trace_xfs_buf_item_push(bip);
+ xfs_buf_delwri_queue(bp);
xfs_buf_relse(bp);
}