diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2014-09-03 21:35:41 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 13:38:42 -0700 |
commit | 2196d6e8a71fc901e31c1d81581fc6cc6c64913e (patch) | |
tree | 41d1aaaafcd9e6792a3a368407f4416c6d4b7ac8 /fs/btrfs/extent-tree.c | |
parent | 15484377f597ca98ee84de87caa13667ea68bb14 (diff) | |
download | talos-op-linux-2196d6e8a71fc901e31c1d81581fc6cc6c64913e.tar.gz talos-op-linux-2196d6e8a71fc901e31c1d81581fc6cc6c64913e.zip |
Btrfs: Fix misuse of chunk mutex
There were several problems about chunk mutex usage:
- Lock chunk mutex when updating metadata. It would cause the nested
deadlock because updating metadata might need allocate new chunks
that need acquire chunk mutex. We remove chunk mutex at this case,
because b-tree lock and other lock mechanism can help us.
- ABBA deadlock occured between device_list_mutex and chunk_mutex.
When we update device status, we must acquire device_list_mutex at the
beginning, and then we might get chunk_mutex during the device status
update because we need allocate new chunks for metadata COW. But at
most place, we acquire chunk_mutex at first and then acquire device list
mutex. We need change the lock order.
- Some place we needn't acquire chunk_mutex. For example we needn't get
chunk_mutex when we free a empty seed fs_devices structure.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 2191a2c7496b..b30ddb49cfab 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -9415,8 +9415,6 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, memcpy(&key, &block_group->key, sizeof(key)); - btrfs_clear_space_info_full(root->fs_info); - btrfs_put_block_group(block_group); btrfs_put_block_group(block_group); |