mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Btrfs: make sure we cleanup all reloc roots if error happens
I hit an oops when merging reloc roots fails, the reason is that new reloc roots may be added and we should make sure we cleanup all reloc roots. Signed-off-by: Wang Shilong <[email protected]> Signed-off-by: Chris Mason <[email protected]>
This commit is contained in:
parent
6646374863
commit
467bb1d27c
1 changed files with 7 additions and 0 deletions
|
|
@ -2409,6 +2409,13 @@ out:
|
|||
btrfs_std_error(root->fs_info, ret);
|
||||
if (!list_empty(&reloc_roots))
|
||||
free_reloc_roots(&reloc_roots);
|
||||
|
||||
/* new reloc root may be added */
|
||||
mutex_lock(&root->fs_info->reloc_mutex);
|
||||
list_splice_init(&rc->reloc_roots, &reloc_roots);
|
||||
mutex_unlock(&root->fs_info->reloc_mutex);
|
||||
if (!list_empty(&reloc_roots))
|
||||
free_reloc_roots(&reloc_roots);
|
||||
}
|
||||
|
||||
BUG_ON(!RB_EMPTY_ROOT(&rc->reloc_root_tree.rb_root));
|
||||
|
|
|
|||
Loading…
Reference in a new issue