7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit 7f5e8bf335e5e257fb82cf5b3521980ded60e863 upstream. LOLLM observes a couple of problems with this callsite -- an ENOMEM return is completely ignored and a subsequent run through the loop body obliterates the return value completely. Also, an error value indicating that the list is corrupt can get passed up (thus terminating the repair) even though we can handle corrupt lists. Fix the callsite not to have these problems. Cc: stable@vger.kernel.org # v6.10 Fixes: ab97f4b1c03075 ("xfs: repair AGI unlinked inode bucket lists") Signed-off-by: Darrick J. Wong Assisted-by: LOLLM # finding obvious bugs Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- fs/xfs/scrub/agheader_repair.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/fs/xfs/scrub/agheader_repair.c +++ b/fs/xfs/scrub/agheader_repair.c @@ -1325,8 +1325,12 @@ xrep_iunlink_mark_ondisk_rec( */ error = xchk_iget(ragi->sc, xfs_agino_to_ino(sc->sa.pag, agino), &ip); - if (error) + if (error == -ENOMEM) + return error; + if (error) { + error = 0; continue; + } trace_xrep_iunlink_reload_ondisk(ip);