File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1026,6 +1026,10 @@ int btrfs_quota_enable(struct btrfs_fs_info *fs_info)
1026
1026
btrfs_item_key_to_cpu (leaf , & found_key , slot );
1027
1027
1028
1028
if (found_key .type == BTRFS_ROOT_REF_KEY ) {
1029
+
1030
+ /* Release locks on tree_root before we access quota_root */
1031
+ btrfs_release_path (path );
1032
+
1029
1033
ret = add_qgroup_item (trans , quota_root ,
1030
1034
found_key .offset );
1031
1035
if (ret ) {
@@ -1044,6 +1048,20 @@ int btrfs_quota_enable(struct btrfs_fs_info *fs_info)
1044
1048
btrfs_abort_transaction (trans , ret );
1045
1049
goto out_free_path ;
1046
1050
}
1051
+ ret = btrfs_search_slot_for_read (tree_root , & found_key ,
1052
+ path , 1 , 0 );
1053
+ if (ret < 0 ) {
1054
+ btrfs_abort_transaction (trans , ret );
1055
+ goto out_free_path ;
1056
+ }
1057
+ if (ret > 0 ) {
1058
+ /*
1059
+ * Shouldn't happen, but in case it does we
1060
+ * don't need to do the btrfs_next_item, just
1061
+ * continue.
1062
+ */
1063
+ continue ;
1064
+ }
1047
1065
}
1048
1066
ret = btrfs_next_item (tree_root , path );
1049
1067
if (ret < 0 ) {
You can’t perform that action at this time.
0 commit comments