Skip to content

Commit d16480c

Browse files
committed
tools/cephfs: Fix first-damage to include missing dirs
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 <[email protected]>
1 parent f9d771f commit d16480c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tools/cephfs/first-damage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@
6060
REPAIR_NOSNAP = None
6161

6262
CEPH_NOSNAP = 0xfffffffe # int32 -2
63+
ROOT_INODE = "1.00000000"
64+
LOST_FOUND_INODE = "4.00000000"
6365

6466
DIR_PATTERN = re.compile(r'[0-9a-fA-F]{8,}\.[0-9a-fA-F]+')
6567

6668
CACHE = set()
6769

6870
def traverse(MEMO, ioctx):
6971
for o in ioctx.list_objects():
70-
if not DIR_PATTERN.fullmatch(o.key):
72+
if not DIR_PATTERN.fullmatch(o.key) and o.key not in [ROOT_INODE, LOST_FOUND_INODE]:
7173
log.debug("skipping %s", o.key)
7274
continue
7375
elif o.key in CACHE:

0 commit comments

Comments
 (0)