aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-14 01:53:49 -0500
committerBen Myers <bpm@sgi.com>2012-11-15 22:35:09 -0500
commitb0f539de9fcc543a3ffa40bc22bf51aca6ea6183 (patch)
treefe2e14add152900a3bd480714c886f8a86a2082d /fs/xfs/xfs_inode.c
parent612cfbfe174a89d565363fff7f3961a2dda5fb71 (diff)
xfs: connect up write verifiers to new buffers
Metadata buffers that are read from disk have write verifiers already attached to them, but newly allocated buffers do not. Add appropriate write verifiers to all new metadata buffers. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 910b2da01042..dfcbe73f1db4 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -420,7 +420,7 @@ xfs_inode_buf_verify(
420 xfs_inobp_check(mp, bp); 420 xfs_inobp_check(mp, bp);
421} 421}
422 422
423static void 423void
424xfs_inode_buf_write_verify( 424xfs_inode_buf_write_verify(
425 struct xfs_buf *bp) 425 struct xfs_buf *bp)
426{ 426{
@@ -1782,6 +1782,18 @@ xfs_ifree_cluster(
1782 1782
1783 if (!bp) 1783 if (!bp)
1784 return ENOMEM; 1784 return ENOMEM;
1785
1786 /*
1787 * This buffer may not have been correctly initialised as we
1788 * didn't read it from disk. That's not important because we are
1789 * only using to mark the buffer as stale in the log, and to
1790 * attach stale cached inodes on it. That means it will never be
1791 * dispatched for IO. If it is, we want to know about it, and we
1792 * want it to fail. We can acheive this by adding a write
1793 * verifier to the buffer.
1794 */
1795 bp->b_pre_io = xfs_inode_buf_write_verify;
1796
1785 /* 1797 /*
1786 * Walk the inodes already attached to the buffer and mark them 1798 * Walk the inodes already attached to the buffer and mark them
1787 * stale. These will all have the flush locks held, so an 1799 * stale. These will all have the flush locks held, so an