From 2939a5f53e7bf1a7497a870defd54449954d553f Mon Sep 17 00:00:00 2001 From: Kernel Build Daemon Date: May 30 2023 05:00:15 +0000 Subject: Merge branch 'stable' into ALP-current --- diff --git a/patches.suse/xfs-fix-livelock-in-delayed-allocation-at-ENOSPC.patch b/patches.suse/xfs-fix-livelock-in-delayed-allocation-at-ENOSPC.patch new file mode 100644 index 0000000..da224bd --- /dev/null +++ b/patches.suse/xfs-fix-livelock-in-delayed-allocation-at-ENOSPC.patch @@ -0,0 +1,52 @@ +From: Dave Chinner +Date: Thu, 27 Apr 2023 09:02:11 +1000 +Subject: xfs: fix livelock in delayed allocation at ENOSPC +Git-commit: 9419092fb2630c30e4ffeb9ef61007ef0c61827a +Patch-mainline: 6.4-rc1 +References: brc#2208553 xfs-issue + +On a filesystem with a non-zero stripe unit and a large sequential +write, delayed allocation will set a minimum allocation length of +the stripe unit. If allocation fails because there are no extents +long enough for an aligned minlen allocation, it is supposed to +fall back to unaligned allocation which allows single block extents +to be allocated. + +When the allocator code was rewritting in the 6.3 cycle, this +fallback was broken - the old code used args->fsbno as the both the +allocation target and the allocation result, the new code passes the +target as a separate parameter. The conversion didn't handle the +aligned->unaligned fallback path correctly - it reset args->fsbno to +the target fsbno on failure which broke allocation failure detection +in the high level code and so it never fell back to unaligned +allocations. + +This resulted in a loop in writeback trying to allocate an aligned +block, getting a false positive success, trying to insert the result +in the BMBT. This did nothing because the extent already was in the +BMBT (merge results in an unchanged extent) and so it returned the +prior extent to the conversion code as the current iomap. + +Because the iomap returned didn't cover the offset we tried to map, +xfs_convert_blocks() then retries the allocation, which fails in the +same way and now we have a livelock. + +Reported-and-tested-by: Brian Foster +Fixes: 85843327094f ("xfs: factor xfs_bmap_btalloc()") +Signed-off-by: Dave Chinner +Reviewed-by: Darrick J. Wong +Signed-off-by: Jiri Slaby +--- + fs/xfs/libxfs/xfs_bmap.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/fs/xfs/libxfs/xfs_bmap.c ++++ b/fs/xfs/libxfs/xfs_bmap.c +@@ -3505,7 +3505,6 @@ xfs_bmap_btalloc_at_eof( + * original non-aligned state so the caller can proceed on allocation + * failure as if this function was never called. + */ +- args->fsbno = ap->blkno; + args->alignment = 1; + return 0; + } diff --git a/series.conf b/series.conf index b0d8d15..1fbe43d 100644 --- a/series.conf +++ b/series.conf @@ -1370,10 +1370,10 @@ ######################################################## # sorted patches ######################################################## - patches.suse/usbtv-usbtv_set_regs-the-pipe-is-output.patch patches.suse/ath11k-pci-Add-more-MODULE_FIRMWARE-entries.patch patches.suse/powerpc-64-Always-build-with-128-bit-long-double.patch + patches.suse/xfs-fix-livelock-in-delayed-allocation-at-ENOSPC.patch ######################################################## # end of sorted patches diff --git a/supported.conf b/supported.conf index 59c3a5b..768f5a8 100644 --- a/supported.conf +++ b/supported.conf @@ -4169,7 +4169,7 @@ net/rds/rds_tcp # RDS over TCP net/rfkill/rfkill # RF switch subsystem support net/rfkill/rfkill-gpio # GPIO rfkill driver -- net/rose/rose +- net/rose/rose # review CVE-2022-2961/bsc#1202660 before marking supported - net/rxrpc/rxrpc - net/rxrpc/rxperf net/sched/act_bpf # traffic control: BPF based action (bsc#1034907)