Unverified Commit 37dafafe authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14893 btrfs: flush delalloc workers queue before stopping cleaner kthread during unmount

parents 876c3b68 19beddfb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4323,6 +4323,15 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info)
	 * already the cleaner, but below we run all pending delayed iputs.
	 */
	btrfs_flush_workqueue(fs_info->fixup_workers);
	/*
	 * Similar case here, we have to wait for delalloc workers before we
	 * proceed below and stop the cleaner kthread, otherwise we trigger a
	 * use-after-tree on the cleaner kthread task_struct when a delalloc
	 * worker running submit_compressed_extents() adds a delayed iput, which
	 * does a wake up on the cleaner kthread, which was already freed below
	 * when we call kthread_stop().
	 */
	btrfs_flush_workqueue(fs_info->delalloc_workers);

	/*
	 * After we parked the cleaner kthread, ordered extents may have