Skip to content

Commit ec46207

Browse files
committed
Add missing array increment to dsl_deadlist_move_bpobj()
dc5c800 was recently merged to prefetch up to 128 deadlists. Unfortunately, a loop was missing an increment, such that it will prefetch all deadlists. The performance properties of that patch probably should be re-evaluated. This was caught by CodeQL's cpp/constant-comparison check in an experimental branch where I am testing the security-and-extended queries. It complained about the `i < 128` part of the loop condition always evaluating to the same thing. The standard CodeQL configuration we use missed this because it does not include that check. Signed-off-by: Richard Yao <[email protected]>
1 parent 93682cd commit ec46207

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/zfs/dsl_deadlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ dsl_deadlist_move_bpobj(dsl_deadlist_t *dl, bpobj_t *bpo, uint64_t mintxg,
943943
* Prefetch up to 128 deadlists first and then more as we progress.
944944
* The limit is a balance between ARC use and diminishing returns.
945945
*/
946-
for (pdle = dle, i = 0; pdle && i < 128; ) {
946+
for (pdle = dle, i = 0; pdle && i < 128; i++) {
947947
bpobj_prefetch_subobj(bpo, pdle->dle_bpobj.bpo_object);
948948
pdle = AVL_NEXT(&dl->dl_tree, pdle);
949949
}

0 commit comments

Comments
 (0)