Skip to content

Commit 2e76f18

Browse files
committed
xfs: cancel intents immediately if process_intents fails
If processing recovered log intent items fails, we need to cancel all the unprocessed recovered items immediately so that a subsequent AIL push in the bail out path won't get wedged on the pinned intent items that didn't get processed. This can happen if the log contains (1) an intent that gets and releases an inode, (2) an intent that cannot be recovered successfully, and (3) some third intent item. When recovery of (2) fails, we leave (3) pinned in memory. Inode reclamation is called in the error-out path of xfs_mountfs before xfs_log_cancel_mount. Reclamation calls xfs_ail_push_all_sync, which gets stuck waiting for (3). Therefore, call xlog_recover_cancel_intents if _process_intents fails. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]>
1 parent 25219db commit 2e76f18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/xfs/xfs_log_recover.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,6 +3446,14 @@ xlog_recover_finish(
34463446
int error;
34473447
error = xlog_recover_process_intents(log);
34483448
if (error) {
3449+
/*
3450+
* Cancel all the unprocessed intent items now so that
3451+
* we don't leave them pinned in the AIL. This can
3452+
* cause the AIL to livelock on the pinned item if
3453+
* anyone tries to push the AIL (inode reclaim does
3454+
* this) before we get around to xfs_log_mount_cancel.
3455+
*/
3456+
xlog_recover_cancel_intents(log);
34493457
xfs_alert(log->l_mp, "Failed to recover intents");
34503458
return error;
34513459
}

0 commit comments

Comments
 (0)