mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-26 02:04:33 +07:00
Btrfs: make the cleaner complete early when the fs is going to be umounted
Cc: David Sterba <dsterba@suse.cz> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:
parent
d027824564
commit
05323cd135
@ -1674,12 +1674,14 @@ static void end_workqueue_fn(struct btrfs_work *work)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we remount the fs to be R/O, the cleaner needn't do anything except
|
* If we remount the fs to be R/O or umount the fs, the cleaner needn't do
|
||||||
* sleeping. This function is used to check the status of the fs.
|
* anything except sleeping. This function is used to check the status of
|
||||||
|
* the fs.
|
||||||
*/
|
*/
|
||||||
static inline int need_cleaner_sleep(struct btrfs_root *root)
|
static inline int need_cleaner_sleep(struct btrfs_root *root)
|
||||||
{
|
{
|
||||||
return root->fs_info->sb->s_flags & MS_RDONLY;
|
return (root->fs_info->sb->s_flags & MS_RDONLY ||
|
||||||
|
btrfs_fs_closing(root->fs_info));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cleaner_kthread(void *arg)
|
static int cleaner_kthread(void *arg)
|
||||||
@ -1702,8 +1704,8 @@ static int cleaner_kthread(void *arg)
|
|||||||
mutex_unlock(&root->fs_info->cleaner_mutex);
|
mutex_unlock(&root->fs_info->cleaner_mutex);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The defragger has dealt with the R/O remount, needn't
|
* The defragger has dealt with the R/O remount and umount,
|
||||||
* do anything special here.
|
* needn't do anything special here.
|
||||||
*/
|
*/
|
||||||
btrfs_run_defrag_inodes(root->fs_info);
|
btrfs_run_defrag_inodes(root->fs_info);
|
||||||
sleep:
|
sleep:
|
||||||
|
Loading…
Reference in New Issue
Block a user