Skip to contentSkip to conversation

xfs: fix log recovery erroring out on refcount recovery failure

PATCH In review Darrick J. Wong 2 participants 2 messages Feb 23, 2024 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfs: fix log recovery erroring out on refcount recovery failure

From: Darrick J. Wong <[email protected]>

Per the comment in the error case of xfs_reflink_recover_cow, zero out any error (after shutting down the log) so that we actually kill any new intent items that might have gotten logged by later recovery steps. Discovered by xfs/434, which few people actually seem to run.

Fixes 2c1e31ed5c88 ("xfs: place intent recovery under NOFS allocation context")

---
v2: actually send it to the list this time

---
 fs/xfs/xfs_log_recover.c |    1 +
 1 file changed, 1 insertion(+)
fs/xfs/xfs_log_recover.c +1 -0
index cd134830a695..13f1d2e91540 100644
@@ -3532,6 +3532,7 @@ xlog_recover_finish(
 		 * and AIL.
 		 */
 		xlog_force_shutdown(log, SHUTDOWN_LOG_IO_ERROR);
+		error = 0;
 		goto out_error;
 	}
 
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

Per the comment in the error case of xfs_reflink_recover_cow, zero out any error (after shutting down the log) so that we actually kill any new intent items that might have gotten logged by later recovery steps. Discovered by xfs/434, which few people actually seem to run.

Talking about xfs/434, it just caused me some nasty debugging headache last week. It is the first of only three tests requiring a loadable xfs module, and when there is an xfs.ko for the uname around but xfs is built into the kernel as it is for my usual test configs it fails in completely weird and hard to debug ways.

The fact that it requires a modular xfs might also be the reason why it's rarely run.

The fix itself looks good: