aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_zone_alloc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2025-06-05 06:16:27 +0000
committerCarlos Maiolino <[email protected]>2025-06-16 08:05:08 +0000
commitb0f77d301eb2b4e1fc816f33ade8519ae7f894f4 (patch)
tree4e1dc53cfb79aaf425850637abbc2f6608cd1e02 /fs/xfs/xfs_zone_alloc.c
parentLinux 6.16-rc2 (diff)
downloadkernel-b0f77d301eb2b4e1fc816f33ade8519ae7f894f4.tar.gz
kernel-b0f77d301eb2b4e1fc816f33ade8519ae7f894f4.zip
xfs: check for shutdown before going to sleep in xfs_select_zone
Ensure the file system hasn't been shut down before waiting for a free zone to become available, because that won't happen on a shut down file system. Without this processes can occasionally get stuck in the allocator wait loop when racing with a file system shutdown. This sporadically happens when running generic/388 or generic/475. Fixes: 4e4d52075577 ("xfs: add the zoned space allocator") Reported-by: Shinichiro Kawasaki <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Hans Holmberg <[email protected]> Tested-by: Shin'ichiro Kawasaki <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_zone_alloc.c')
-rw-r--r--fs/xfs/xfs_zone_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index 80add26c0111..0de6f64b3169 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -727,7 +727,7 @@ xfs_select_zone(
for (;;) {
prepare_to_wait(&zi->zi_zone_wait, &wait, TASK_UNINTERRUPTIBLE);
oz = xfs_select_zone_nowait(mp, write_hint, pack_tight);
- if (oz)
+ if (oz || xfs_is_shutdown(mp))
break;
schedule();
}