From df2d65c5ae9d593366d74b22b0565941e678e6c9 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Fri, 24 May 2024 13:38:24 +0530 Subject: [PATCH] tools/first-damage: Fix struct unpack 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 --- src/tools/cephfs/first-damage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/cephfs/first-damage.py b/src/tools/cephfs/first-damage.py index 23dc503297692..b8bfdf9271d80 100644 --- a/src/tools/cephfs/first-damage.py +++ b/src/tools/cephfs/first-damage.py @@ -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(' 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: -- 2.39.5