diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2014-09-03 17:35:41 +0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-18 00:38:42 +0400 |
commit | 2196d6e8a71fc901e31c1d81581fc6cc6c64913e (patch) | |
tree | 41d1aaaafcd9e6792a3a368407f4416c6d4b7ac8 /include/media/media-entity.h | |
parent | 15484377f597ca98ee84de87caa13667ea68bb14 (diff) | |
download | linux-2196d6e8a71fc901e31c1d81581fc6cc6c64913e.tar.xz |
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 'include/media/media-entity.h')
0 files changed, 0 insertions, 0 deletions