6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit 8c4f172c246717b1420f138a159ed15c315a58bd upstream. LOLLM noticed that we stop the sort early but don't actually pass along the error code, which could enable repair code to continue running with an unsorted array. Fix that. Cc: stable@vger.kernel.org # v6.9 Fixes: ee13fc67205b98 ("xfs: convert xfarray_pagesort to deal with large folios") 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/xfarray.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/xfs/scrub/xfarray.c +++ b/fs/xfs/scrub/xfarray.c @@ -943,8 +943,10 @@ xfarray_sort( * problems, we're done. */ ret = xfarray_foliosort(si, lo, hi); - if (ret < 0) + if (ret < 0) { + error = ret; goto out_free; + } if (ret == 1) { si->stack_depth--; continue;