]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix bug with rgw-gap-list
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 25 Mar 2025 22:10:27 +0000 (18:10 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Wed, 4 Jun 2025 20:01:28 +0000 (16:01 -0400)
rgw-gap-list would fail if it it reached the end of the second file
before the first, thereby causing an infinite loop.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
Signed-off-by: Michael J. Kidd <linuxkidd@gmail.com>
(cherry picked from commit 0cfbc57d2c43ea88845561f14e295d0d48e44b32)

src/rgw/rgw-gap-list

index 5018cedd7cb652cf21b57c0df160d049191efdda..3dc0e5def2ff0a528a0687f64c1d66e6deadf1ec 100755 (executable)
@@ -400,9 +400,12 @@ BEGIN {
   f1_count++
   if(f2_eof==0) {
     if(test_lines()==2) {
-      while ($1>b[1]) {
+      while ($1>b[1] && !f2_eof) {
         advance_f2()
       }
+      if (f2_eof) {
+        line_out()
+      }
       test_lines()
     }
   } else {