]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbtorture: fix regression in smb2.bench
authorRalph Boehme <slow@samba.org>
Wed, 15 Oct 2025 14:30:20 +0000 (16:30 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 16 Oct 2025 18:42:05 +0000 (18:42 +0000)
The changes in b6757378be23 caused a regression where only the first
connection was used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15934

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct 16 18:42:05 UTC 2025 on atb-devel-224

source4/torture/smb2/bench.c

index 48c7aabea4f83ea2d5d59cc1afe72516343fa4bd..08b9ab513ac5019f3b733f5374c9b4af49284a63 100644 (file)
@@ -445,17 +445,13 @@ static bool test_smb2_bench_echo(struct torture_context *tctx,
                }
        }
 
-       for (li = 0, i = 0; i <state->num_conns; i++) {
-               size_t pcli;
+       for (li = 0; li <state->num_loops; li++) {
+               struct test_smb2_bench_echo_loop *loop = &state->loops[li];
 
-               for (pcli = 0; pcli < torture_qdepth; pcli++) {
-                       struct test_smb2_bench_echo_loop *loop = &state->loops[li];
-
-                       tevent_schedule_immediate(loop->im,
-                                                 tctx->ev,
-                                                 test_smb2_bench_echo_loop_start,
-                                                 loop);
-               }
+               tevent_schedule_immediate(loop->im,
+                                         tctx->ev,
+                                         test_smb2_bench_echo_loop_start,
+                                         loop);
        }
 
        torture_comment(tctx, "Opened %zu connections with qdepth=%d => %zu loops\n",
@@ -927,17 +923,13 @@ bool test_smb2_bench_path_contention_shared(struct torture_context *tctx,
                }
        }
 
-       for (li = 0, i = 0; i <state->num_conns; i++) {
-               size_t pcli;
+       for (li = 0; li <state->num_loops; li++) {
+               struct test_smb2_bench_path_contention_shared_loop *loop = &state->loops[li];
 
-               for (pcli = 0; pcli < torture_qdepth; pcli++) {
-                       struct test_smb2_bench_path_contention_shared_loop *loop = &state->loops[li];
-
-                       tevent_schedule_immediate(loop->im,
-                                                 tctx->ev,
-                                                 test_smb2_bench_path_contention_loop_start,
-                                                 loop);
-               }
+               tevent_schedule_immediate(loop->im,
+                                         tctx->ev,
+                                         test_smb2_bench_path_contention_loop_start,
+                                         loop);
        }
 
        torture_comment(tctx, "Opened %zu connections with qdepth=%d => %zu loops\n",
@@ -1347,17 +1339,13 @@ static bool test_smb2_bench_read(struct torture_context *tctx,
                }
        }
 
-       for (li = 0, i = 0; i <state->num_conns; i++) {
-               size_t pcli;
+       for (li = 0; li <state->num_loops; li++) {
+               struct test_smb2_bench_read_loop *loop = &state->loops[li];
 
-               for (pcli = 0; pcli < torture_qdepth; pcli++) {
-                       struct test_smb2_bench_read_loop *loop = &state->loops[li];
-
-                       tevent_schedule_immediate(loop->im,
-                                                 tctx->ev,
-                                                 test_smb2_bench_read_loop_start,
-                                                 loop);
-               }
+               tevent_schedule_immediate(loop->im,
+                                         tctx->ev,
+                                         test_smb2_bench_read_loop_start,
+                                         loop);
        }
 
        torture_comment(tctx, "Opened %zu connections with qdepth=%d => %zu loops\n",
@@ -1833,17 +1821,13 @@ static bool test_smb2_bench_session_setup(struct torture_context *tctx,
                }
        }
 
-       for (li = 0, i = 0; i <state->num_conns; i++) {
-               size_t pcli;
+       for (li = 0; li <state->num_loops; li++) {
+               struct test_smb2_bench_session_setup_shared_loop *loop = &state->loops[li];
 
-               for (pcli = 0; pcli < torture_qdepth; pcli++) {
-                       struct test_smb2_bench_session_setup_shared_loop *loop = &state->loops[li];
-
-                       tevent_schedule_immediate(loop->im,
-                                                 tctx->ev,
-                                                 test_smb2_bench_session_setup_loop_start,
-                                                 loop);
-               }
+               tevent_schedule_immediate(loop->im,
+                                         tctx->ev,
+                                         test_smb2_bench_session_setup_loop_start,
+                                         loop);
        }
 
        torture_comment(tctx, "Opened %zu connections with qdepth=%d => %zu loops\n",