]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs: Fix first-damage to include missing dirs
authorKotresh HR <khiremat@redhat.com>
Wed, 28 Feb 2024 12:04:37 +0000 (17:34 +0530)
committerKotresh HR <khiremat@redhat.com>
Thu, 7 Mar 2024 11:48:05 +0000 (17:18 +0530)
Don't skip root and lost+found directories while
checking for damaged metadata.

Fixes: https://tracker.ceph.com/issues/64615
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/tools/cephfs/first-damage.py

index 0479dc8cb2a6c4e3a8e286df54b36e227f4fa547..23dc5032976927e90086fed98fe3906eef5a9778 100644 (file)
@@ -60,6 +60,8 @@ CONF = os.environ.get('CEPH_CONF')
 REPAIR_NOSNAP = None
 
 CEPH_NOSNAP = 0xfffffffe # int32 -2
+ROOT_INODE  = "1.00000000"
+LOST_FOUND_INODE  = "4.00000000"
 
 DIR_PATTERN = re.compile(r'[0-9a-fA-F]{8,}\.[0-9a-fA-F]+')
 
@@ -67,7 +69,7 @@ CACHE = set()
 
 def traverse(MEMO, ioctx):
     for o in ioctx.list_objects():
-        if not DIR_PATTERN.fullmatch(o.key):
+        if not DIR_PATTERN.fullmatch(o.key) and o.key not in [ROOT_INODE, LOST_FOUND_INODE]:
             log.debug("skipping %s", o.key)
             continue
         elif o.key in CACHE: