summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2022-09-08 12:31:50 +0100
committerDavid Sterba <dsterba@suse.com>2022-09-13 14:05:08 +0200
commit8a1f1e3d1eecf9d2359a2709e276743a67e145db (patch)
treed1e4b2b6da17904cddb079e168ffde3bf04e4916 /fs/binfmt_elf.c
parent5da431b71d4b9be3c8cf6786eff9e2d41a5f9f65 (diff)
downloadlinux-stable-8a1f1e3d1eecf9d2359a2709e276743a67e145db.tar.gz
linux-stable-8a1f1e3d1eecf9d2359a2709e276743a67e145db.tar.bz2
linux-stable-8a1f1e3d1eecf9d2359a2709e276743a67e145db.zip
btrfs: fix hang during unmount when stopping block group reclaim worker
During early unmount, at close_ctree(), we try to stop the block group reclaim task with cancel_work_sync(), but that may hang if the block group reclaim task is currently at btrfs_relocate_block_group() waiting for the flag BTRFS_FS_UNFINISHED_DROPS to be cleared from fs_info->flags. During unmount we only clear that flag later, after trying to stop the block group reclaim task. Fix that by clearing BTRFS_FS_UNFINISHED_DROPS before trying to stop the block group reclaim task and after setting BTRFS_FS_CLOSING_START, so that if the reclaim task is waiting on that bit, it will stop immediately after being woken, because it sees the filesystem is closing (with a call to btrfs_fs_closing()), and then returns immediately with -EINTR. Fixes: 31e70e527806c5 ("btrfs: fix hang during unmount when block group reclaim task is running") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/binfmt_elf.c')
0 files changed, 0 insertions, 0 deletions