Skip to contentSkip to conversation

Btrfs: don't delete fs_roots until after we cleanup the transaction

PATCH New Josef Bacik 1 participant 1 message Jun 6, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: don't delete fs_roots until after we cleanup the transaction

We get a use after free if we had a transaction to cleanup since there could be delayed inodes which refer to their respective fs_root. Thanks

---
 fs/btrfs/disk-io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/disk-io.c +1 -1
index 15f31c7..3c2886c 100644
@@ -2887,8 +2887,8 @@ fail_qgroup:
 	btrfs_free_qgroup_config(fs_info);
 fail_trans_kthread:
 	kthread_stop(fs_info->transaction_kthread);
-	del_fs_roots(fs_info);
 	btrfs_cleanup_transaction(fs_info->tree_root);
+	del_fs_roots(fs_info);
 fail_cleaner:
 	kthread_stop(fs_info->cleaner_kthread);
 
Signature · 1 line
1.7.7.6