Skip to content

Commit b0f77d3

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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: 4e4d520 ("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]>
1 parent e04c78d commit b0f77d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_zone_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ xfs_select_zone(
727727
for (;;) {
728728
prepare_to_wait(&zi->zi_zone_wait, &wait, TASK_UNINTERRUPTIBLE);
729729
oz = xfs_select_zone_nowait(mp, write_hint, pack_tight);
730-
if (oz)
730+
if (oz || xfs_is_shutdown(mp))
731731
break;
732732
schedule();
733733
}

0 commit comments

Comments
 (0)