Commit e98084b8 authored by Dave Chinner's avatar Dave Chinner Committed by Darrick J. Wong

xfs: move xfs_clear_li_failed out of xfs_ail_delete_one()

xfs_ail_delete_one() is called directly from dquot and inode IO
completion, as well as from the generic xfs_trans_ail_delete()
function. Inodes are about to have their own failure handling, and
dquots will in future, too. Pull the clearing of the LI_FAILED flag
up into the callers so we can customise the code appropriately.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 3536b61e
...@@ -1070,16 +1070,12 @@ xfs_qm_dqflush_done( ...@@ -1070,16 +1070,12 @@ xfs_qm_dqflush_done(
test_bit(XFS_LI_FAILED, &lip->li_flags))) { test_bit(XFS_LI_FAILED, &lip->li_flags))) {
spin_lock(&ailp->ail_lock); spin_lock(&ailp->ail_lock);
xfs_clear_li_failed(lip);
if (lip->li_lsn == qip->qli_flush_lsn) { if (lip->li_lsn == qip->qli_flush_lsn) {
/* xfs_ail_update_finish() drops the AIL lock */ /* xfs_ail_update_finish() drops the AIL lock */
tail_lsn = xfs_ail_delete_one(ailp, lip); tail_lsn = xfs_ail_delete_one(ailp, lip);
xfs_ail_update_finish(ailp, tail_lsn); xfs_ail_update_finish(ailp, tail_lsn);
} else { } else {
/*
* Clear the failed state since we are about to drop the
* flush lock
*/
xfs_clear_li_failed(lip);
spin_unlock(&ailp->ail_lock); spin_unlock(&ailp->ail_lock);
} }
} }
......
...@@ -690,12 +690,11 @@ xfs_iflush_done( ...@@ -690,12 +690,11 @@ xfs_iflush_done(
/* this is an opencoded batch version of xfs_trans_ail_delete */ /* this is an opencoded batch version of xfs_trans_ail_delete */
spin_lock(&ailp->ail_lock); spin_lock(&ailp->ail_lock);
list_for_each_entry(lip, &tmp, li_bio_list) { list_for_each_entry(lip, &tmp, li_bio_list) {
xfs_clear_li_failed(lip);
if (lip->li_lsn == INODE_ITEM(lip)->ili_flush_lsn) { if (lip->li_lsn == INODE_ITEM(lip)->ili_flush_lsn) {
xfs_lsn_t lsn = xfs_ail_delete_one(ailp, lip); xfs_lsn_t lsn = xfs_ail_delete_one(ailp, lip);
if (!tail_lsn && lsn) if (!tail_lsn && lsn)
tail_lsn = lsn; tail_lsn = lsn;
} else {
xfs_clear_li_failed(lip);
} }
} }
xfs_ail_update_finish(ailp, tail_lsn); xfs_ail_update_finish(ailp, tail_lsn);
......
...@@ -843,7 +843,6 @@ xfs_ail_delete_one( ...@@ -843,7 +843,6 @@ xfs_ail_delete_one(
trace_xfs_ail_delete(lip, mlip->li_lsn, lip->li_lsn); trace_xfs_ail_delete(lip, mlip->li_lsn, lip->li_lsn);
xfs_ail_delete(ailp, lip); xfs_ail_delete(ailp, lip);
xfs_clear_li_failed(lip);
clear_bit(XFS_LI_IN_AIL, &lip->li_flags); clear_bit(XFS_LI_IN_AIL, &lip->li_flags);
lip->li_lsn = 0; lip->li_lsn = 0;
...@@ -874,6 +873,7 @@ xfs_trans_ail_delete( ...@@ -874,6 +873,7 @@ xfs_trans_ail_delete(
} }
/* xfs_ail_update_finish() drops the AIL lock */ /* xfs_ail_update_finish() drops the AIL lock */
xfs_clear_li_failed(lip);
tail_lsn = xfs_ail_delete_one(ailp, lip); tail_lsn = xfs_ail_delete_one(ailp, lip);
xfs_ail_update_finish(ailp, tail_lsn); xfs_ail_update_finish(ailp, tail_lsn);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment