@@ -951,12 +951,6 @@ int __bch2_read_extent(struct btree_trans *trans, struct bch_read_bio *orig,
951
951
goto retry_pick ;
952
952
}
953
953
954
- /*
955
- * Unlock the iterator while the btree node's lock is still in
956
- * cache, before doing the IO:
957
- */
958
- bch2_trans_unlock (trans );
959
-
960
954
if (flags & BCH_READ_NODECODE ) {
961
955
/*
962
956
* can happen if we retry, and the extent we were going to read
@@ -1113,6 +1107,15 @@ int __bch2_read_extent(struct btree_trans *trans, struct bch_read_bio *orig,
1113
1107
trace_and_count (c , read_split , & orig -> bio );
1114
1108
}
1115
1109
1110
+ /*
1111
+ * Unlock the iterator while the btree node's lock is still in
1112
+ * cache, before doing the IO:
1113
+ */
1114
+ if (!(flags & BCH_READ_IN_RETRY ))
1115
+ bch2_trans_unlock (trans );
1116
+ else
1117
+ bch2_trans_unlock_long (trans );
1118
+
1116
1119
if (!rbio -> pick .idx ) {
1117
1120
if (unlikely (!rbio -> have_ioref )) {
1118
1121
struct printbuf buf = PRINTBUF ;
@@ -1160,6 +1163,8 @@ int __bch2_read_extent(struct btree_trans *trans, struct bch_read_bio *orig,
1160
1163
if (likely (!(flags & BCH_READ_IN_RETRY ))) {
1161
1164
return 0 ;
1162
1165
} else {
1166
+ bch2_trans_unlock (trans );
1167
+
1163
1168
int ret ;
1164
1169
1165
1170
rbio -> context = RBIO_CONTEXT_UNBOUND ;
0 commit comments