]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix bug with rgw-gap-list 62524/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 25 Mar 2025 22:10:27 +0000 (18:10 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Wed, 26 Mar 2025 17:58:30 +0000 (13:58 -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>
src/rgw/rgw-gap-list

index 983e8930577905794fcca20f3085d6d1475dc21e..0e092b891d87f58abe53be3f85c7930240dfd852 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 {