6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit 9a263723d7c9ab0615bab3f5cc145d3d24454a5c upstream. If, while processing an unlinked list we see an inode that has nonzero link count, we fail to store the incore prev/next pointers, we should release the incore inode instead of leaking it. This was in the llm fixes branch but fell out for -rc7. Weird. Cc: stable@vger.kernel.org # v7.2-rc7 Fixes: 0052633527158b ("xfs: don't ignore runtime errors in xrep_iunlink_reload_next") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- fs/xfs/scrub/agheader_repair.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/fs/xfs/scrub/agheader_repair.c +++ b/fs/xfs/scrub/agheader_repair.c @@ -1081,12 +1081,9 @@ xrep_iunlink_reload_next( if (VFS_I(ip)->i_nlink != 0) { error = xrep_iunlink_store_next(ragi, agino, NULLAGINO); if (error) - return error; + goto rele; error = xrep_iunlink_store_prev(ragi, agino, LINKED_AGINO); - if (error) - return error; - goto rele; } @@ -1100,7 +1097,7 @@ xrep_iunlink_reload_next( */ rele: xchk_irele(sc, ip); - return 0; + return error; } /*