Skip to content

Commit e98084b

Browse files
Dave Chinnerdjwong
authored andcommitted
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: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent 3536b61 commit e98084b

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

fs/xfs/xfs_dquot.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,16 +1070,12 @@ xfs_qm_dqflush_done(
10701070
test_bit(XFS_LI_FAILED, &lip->li_flags))) {
10711071

10721072
spin_lock(&ailp->ail_lock);
1073+
xfs_clear_li_failed(lip);
10731074
if (lip->li_lsn == qip->qli_flush_lsn) {
10741075
/* xfs_ail_update_finish() drops the AIL lock */
10751076
tail_lsn = xfs_ail_delete_one(ailp, lip);
10761077
xfs_ail_update_finish(ailp, tail_lsn);
10771078
} else {
1078-
/*
1079-
* Clear the failed state since we are about to drop the
1080-
* flush lock
1081-
*/
1082-
xfs_clear_li_failed(lip);
10831079
spin_unlock(&ailp->ail_lock);
10841080
}
10851081
}

fs/xfs/xfs_inode_item.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,11 @@ xfs_iflush_done(
690690
/* this is an opencoded batch version of xfs_trans_ail_delete */
691691
spin_lock(&ailp->ail_lock);
692692
list_for_each_entry(lip, &tmp, li_bio_list) {
693+
xfs_clear_li_failed(lip);
693694
if (lip->li_lsn == INODE_ITEM(lip)->ili_flush_lsn) {
694695
xfs_lsn_t lsn = xfs_ail_delete_one(ailp, lip);
695696
if (!tail_lsn && lsn)
696697
tail_lsn = lsn;
697-
} else {
698-
xfs_clear_li_failed(lip);
699698
}
700699
}
701700
xfs_ail_update_finish(ailp, tail_lsn);

fs/xfs/xfs_trans_ail.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,6 @@ xfs_ail_delete_one(
843843

844844
trace_xfs_ail_delete(lip, mlip->li_lsn, lip->li_lsn);
845845
xfs_ail_delete(ailp, lip);
846-
xfs_clear_li_failed(lip);
847846
clear_bit(XFS_LI_IN_AIL, &lip->li_flags);
848847
lip->li_lsn = 0;
849848

@@ -874,6 +873,7 @@ xfs_trans_ail_delete(
874873
}
875874

876875
/* xfs_ail_update_finish() drops the AIL lock */
876+
xfs_clear_li_failed(lip);
877877
tail_lsn = xfs_ail_delete_one(ailp, lip);
878878
xfs_ail_update_finish(ailp, tail_lsn);
879879
}

0 commit comments

Comments
 (0)