From acab0766e5fd7beec3b6cec2fb2cbad59d39236c Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 16 Sep 2022 15:00:38 -0400 Subject: [PATCH] tools: allow spaces in dentries for first-damage.sh Fixes: https://tracker.ceph.com/issues/57586 Signed-off-by: Patrick Donnelly --- src/tools/cephfs/first-damage.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/cephfs/first-damage.sh b/src/tools/cephfs/first-damage.sh index db50e8bdb0cf..29e233c43878 100755 --- a/src/tools/cephfs/first-damage.sh +++ b/src/tools/cephfs/first-damage.sh @@ -58,7 +58,9 @@ function traverse { mrados ls | grep -E '[[:xdigit:]]{8,}\.[[:xdigit:]]+' > "$T" while read obj; do local O=$(mktemp -p /tmp "$obj".XXXXXX) - for dnk in $(mrados listomapkeys "$obj"); do + local KEYS=$(mktemp -p /tmp "$obj"-keys.XXXXXX) + mrados listomapkeys "$obj" > "$KEYS" + while read dnk; do mrados getomapval "$obj" "$dnk" "$O" local first=$(dd if="$O" bs=1 count=4 | od --endian=little -An -t u8) if [ "$first" -gt "$NEXT_SNAP" ]; then @@ -68,7 +70,7 @@ function traverse { mrados rmomapkey "$obj" "$dnk" fi fi - done + done < "$KEYS" rm "$O" done < "$T" } -- 2.47.3