diff options
author | Chris Mason <clm@fb.com> | 2015-08-09 10:35:33 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-08-09 10:35:33 -0400 |
commit | 46cd28555ffaa40162290dba203daad0ff6f7abd (patch) | |
tree | a10fd81b6c7ff5ea7642b1e2462e529971e8713a /fs/btrfs/disk-io.c | |
parent | da2f0f74cf7d074e5a8918c8efdf6aba4a989b4a (diff) | |
parent | e33e17ee1098d8d751552ac11c111e1c1a3db014 (diff) |
Merge branch 'jeffm-discard-4.3' into for-linus-4.3
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 230546b45474..cc15514b4a76 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -3761,6 +3761,15 @@ void close_ctree(struct btrfs_root *root) | |||
3761 | cancel_work_sync(&fs_info->async_reclaim_work); | 3761 | cancel_work_sync(&fs_info->async_reclaim_work); |
3762 | 3762 | ||
3763 | if (!(fs_info->sb->s_flags & MS_RDONLY)) { | 3763 | if (!(fs_info->sb->s_flags & MS_RDONLY)) { |
3764 | /* | ||
3765 | * If the cleaner thread is stopped and there are | ||
3766 | * block groups queued for removal, the deletion will be | ||
3767 | * skipped when we quit the cleaner thread. | ||
3768 | */ | ||
3769 | mutex_lock(&root->fs_info->cleaner_mutex); | ||
3770 | btrfs_delete_unused_bgs(root->fs_info); | ||
3771 | mutex_unlock(&root->fs_info->cleaner_mutex); | ||
3772 | |||
3764 | ret = btrfs_commit_super(root); | 3773 | ret = btrfs_commit_super(root); |
3765 | if (ret) | 3774 | if (ret) |
3766 | btrfs_err(fs_info, "commit super ret %d", ret); | 3775 | btrfs_err(fs_info, "commit super ret %d", ret); |