aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode_item.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-23 01:58:41 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:33 -0400
commit04913fdd91f342e537005ef1233f98068b925a7f (patch)
treeb8eaacda9302290fb1833d47bf6c7be5813a80cb /fs/xfs/xfs_inode_item.c
parenta8569171ba26344a4c0308fc0da8f41795408ebc (diff)
xfs: pass shutdown method into xfs_trans_ail_delete_bulk
xfs_trans_ail_delete_bulk() can be called from different contexts so if the item is not in the AIL we need different shutdown for each context. Pass in the shutdown method needed so the correct action can be taken. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r--fs/xfs/xfs_inode_item.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 8aaebb2f9efa..3f96a949d963 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -777,7 +777,8 @@ xfs_iflush_done(
777 ASSERT(i <= need_ail); 777 ASSERT(i <= need_ail);
778 } 778 }
779 /* xfs_trans_ail_delete_bulk() drops the AIL lock. */ 779 /* xfs_trans_ail_delete_bulk() drops the AIL lock. */
780 xfs_trans_ail_delete_bulk(ailp, log_items, i); 780 xfs_trans_ail_delete_bulk(ailp, log_items, i,
781 SHUTDOWN_CORRUPT_INCORE);
781 } 782 }
782 783
783 784
@@ -798,16 +799,15 @@ xfs_iflush_done(
798} 799}
799 800
800/* 801/*
801 * This is the inode flushing abort routine. It is called 802 * This is the inode flushing abort routine. It is called from xfs_iflush when
802 * from xfs_iflush when the filesystem is shutting down to clean 803 * the filesystem is shutting down to clean up the inode state. It is
803 * up the inode state. 804 * responsible for removing the inode item from the AIL if it has not been
804 * It is responsible for removing the inode item 805 * re-logged, and unlocking the inode's flush lock.
805 * from the AIL if it has not been re-logged, and unlocking the inode's
806 * flush lock.
807 */ 806 */
808void 807void
809xfs_iflush_abort( 808xfs_iflush_abort(
810 xfs_inode_t *ip) 809 xfs_inode_t *ip,
810 bool stale)
811{ 811{
812 xfs_inode_log_item_t *iip = ip->i_itemp; 812 xfs_inode_log_item_t *iip = ip->i_itemp;
813 813
@@ -817,7 +817,10 @@ xfs_iflush_abort(
817 spin_lock(&ailp->xa_lock); 817 spin_lock(&ailp->xa_lock);
818 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { 818 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
819 /* xfs_trans_ail_delete() drops the AIL lock. */ 819 /* xfs_trans_ail_delete() drops the AIL lock. */
820 xfs_trans_ail_delete(ailp, (xfs_log_item_t *)iip); 820 xfs_trans_ail_delete(ailp, &iip->ili_item,
821 stale ?
822 SHUTDOWN_LOG_IO_ERROR :
823 SHUTDOWN_CORRUPT_INCORE);
821 } else 824 } else
822 spin_unlock(&ailp->xa_lock); 825 spin_unlock(&ailp->xa_lock);
823 } 826 }
@@ -844,7 +847,7 @@ xfs_istale_done(
844 struct xfs_buf *bp, 847 struct xfs_buf *bp,
845 struct xfs_log_item *lip) 848 struct xfs_log_item *lip)
846{ 849{
847 xfs_iflush_abort(INODE_ITEM(lip)->ili_inode); 850 xfs_iflush_abort(INODE_ITEM(lip)->ili_inode, true);
848} 851}
849 852
850/* 853/*