aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2015-12-15 12:09:59 -0500
committerChris Mason <clm@fb.com>2015-12-15 12:09:59 -0500
commit1d3a5a82fe724c53c472a18a31fb0bbf33dfaba2 (patch)
tree992e3c8ba9681fafecd5c8ff9b8ca02ec9acea78 /fs
parentbb1591b4ea1a1485ebc79be4e4748e94f96c670b (diff)
parent94356889c404faf050895099fd0d23f8bef118c4 (diff)
Merge branch 'for-chris-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux into for-linus-4.4
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c10
-rw-r--r--fs/btrfs/free-space-cache.c2
-rw-r--r--fs/btrfs/transaction.c1
-rw-r--r--fs/btrfs/transaction.h2
-rw-r--r--fs/btrfs/volumes.c3
5 files changed, 10 insertions, 8 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)
10480 * until transaction commit to do the actual discard. 10480 * until transaction commit to do the actual discard.
10481 */ 10481 */
10482 if (trimming) { 10482 if (trimming) {
10483 WARN_ON(!list_empty(&block_group->bg_list)); 10483 spin_lock(&fs_info->unused_bgs_lock);
10484 spin_lock(&trans->transaction->deleted_bgs_lock); 10484 /*
10485 * A concurrent scrub might have added us to the list
10486 * fs_info->unused_bgs, so use a list_move operation
10487 * to add the block group to the deleted_bgs list.
10488 */
10485 list_move(&block_group->bg_list, 10489 list_move(&block_group->bg_list,
10486 &trans->transaction->deleted_bgs); 10490 &trans->transaction->deleted_bgs);
10487 spin_unlock(&trans->transaction->deleted_bgs_lock); 10491 spin_unlock(&fs_info->unused_bgs_lock);
10488 btrfs_get_block_group(block_group); 10492 btrfs_get_block_group(block_group);
10489 } 10493 }
10490end_trans: 10494end_trans:
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index e6fc7d9e65b1..f331ef7d573a 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -891,7 +891,7 @@ out:
891 spin_unlock(&block_group->lock); 891 spin_unlock(&block_group->lock);
892 ret = 0; 892 ret = 0;
893 893
894 btrfs_warn(fs_info, "failed to load free space cache for block group %llu, rebuild it now", 894 btrfs_warn(fs_info, "failed to load free space cache for block group %llu, rebuilding it now",
895 block_group->key.objectid); 895 block_group->key.objectid);
896 } 896 }
897 897
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 3367a3c6f214..be8eae80ff65 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -274,7 +274,6 @@ loop:
274 cur_trans->num_dirty_bgs = 0; 274 cur_trans->num_dirty_bgs = 0;
275 spin_lock_init(&cur_trans->dirty_bgs_lock); 275 spin_lock_init(&cur_trans->dirty_bgs_lock);
276 INIT_LIST_HEAD(&cur_trans->deleted_bgs); 276 INIT_LIST_HEAD(&cur_trans->deleted_bgs);
277 spin_lock_init(&cur_trans->deleted_bgs_lock);
278 spin_lock_init(&cur_trans->dropped_roots_lock); 277 spin_lock_init(&cur_trans->dropped_roots_lock);
279 list_add_tail(&cur_trans->list, &fs_info->trans_list); 278 list_add_tail(&cur_trans->list, &fs_info->trans_list);
280 extent_io_tree_init(&cur_trans->dirty_pages, 279 extent_io_tree_init(&cur_trans->dirty_pages,
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 0da21ca9b3fb..64c8221b6165 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -77,8 +77,8 @@ struct btrfs_transaction {
77 */ 77 */
78 struct mutex cache_write_mutex; 78 struct mutex cache_write_mutex;
79 spinlock_t dirty_bgs_lock; 79 spinlock_t dirty_bgs_lock;
80 /* Protected by spin lock fs_info->unused_bgs_lock. */
80 struct list_head deleted_bgs; 81 struct list_head deleted_bgs;
81 spinlock_t deleted_bgs_lock;
82 spinlock_t dropped_roots_lock; 82 spinlock_t dropped_roots_lock;
83 struct btrfs_delayed_ref_root delayed_refs; 83 struct btrfs_delayed_ref_root delayed_refs;
84 int aborted; 84 int aborted;
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 750285e4f274..86124cde907a 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3548,12 +3548,11 @@ again:
3548 3548
3549 ret = btrfs_force_chunk_alloc(trans, chunk_root, 3549 ret = btrfs_force_chunk_alloc(trans, chunk_root,
3550 BTRFS_BLOCK_GROUP_DATA); 3550 BTRFS_BLOCK_GROUP_DATA);
3551 btrfs_end_transaction(trans, chunk_root);
3551 if (ret < 0) { 3552 if (ret < 0) {
3552 mutex_unlock(&fs_info->delete_unused_bgs_mutex); 3553 mutex_unlock(&fs_info->delete_unused_bgs_mutex);
3553 goto error; 3554 goto error;
3554 } 3555 }
3555
3556 btrfs_end_transaction(trans, chunk_root);
3557 chunk_reserved = 1; 3556 chunk_reserved = 1;
3558 } 3557 }
3559 3558