]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/first-damage: Fix struct unpack 57689/head
authorKotresh HR <khiremat@redhat.com>
Fri, 24 May 2024 08:08:24 +0000 (13:38 +0530)
committerKotresh HR <khiremat@redhat.com>
Fri, 24 May 2024 08:17:00 +0000 (13:47 +0530)
The first field is a 64 bit integer, the script
was unpacking it as 32 bit integer. Fixed the
same.

Also printing the 'first' value in debug

Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/tools/cephfs/first-damage.py

index 23dc5032976927e90086fed98fe3906eef5a9778..b8bfdf9271d80ec08c979e3abeb5347ceb35c39b 100644 (file)
@@ -85,7 +85,8 @@ def traverse(MEMO, ioctx):
                 nkey = None
                 for (dnk, val) in it:
                     log.debug(f'\t{dnk}: val size {len(val)}')
-                    (first,) = struct.unpack('<I', val[:4])
+                    (first,) = struct.unpack('<Q', val[:8])
+                    log.debug(f'\t{dnk}: first {first}')
                     if first > NEXT_SNAP:
                         log.warning(f"found {o.key}:{dnk} first (0x{first:x}) > NEXT_SNAP (0x{NEXT_SNAP:x})")
                         if REPAIR_NOSNAP and dnk.endswith(b"_head") and first == CEPH_NOSNAP: