diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-12-23 10:33:34 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-12-23 10:33:34 +0300 |
commit | 59c8231089be96165735585694a801ae58ec6c95 (patch) | |
tree | 41bd60a9aec5df20e07a81fbb526c8bc05e997fc /fs/btrfs/extent-tree.c | |
parent | de5126cc3c0b0f291d08fa591dcdf237bc595a56 (diff) | |
parent | 0fb0b822d157325b66c503d23332f64899bfb828 (diff) | |
download | linux-59c8231089be96165735585694a801ae58ec6c95.tar.xz |
Merge branch 'for-linus' into for-next
Conflicts:
drivers/gpu/drm/i915/intel_pm.c
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4b89680a1923..c4661db2b72a 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -10480,11 +10480,15 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) * until transaction commit to do the actual discard. */ if (trimming) { - WARN_ON(!list_empty(&block_group->bg_list)); - spin_lock(&trans->transaction->deleted_bgs_lock); + spin_lock(&fs_info->unused_bgs_lock); + /* + * A concurrent scrub might have added us to the list + * fs_info->unused_bgs, so use a list_move operation + * to add the block group to the deleted_bgs list. + */ list_move(&block_group->bg_list, &trans->transaction->deleted_bgs); - spin_unlock(&trans->transaction->deleted_bgs_lock); + spin_unlock(&fs_info->unused_bgs_lock); btrfs_get_block_group(block_group); } end_trans: |