From: Patrick Donnelly Date: Fri, 16 Sep 2022 19:00:38 +0000 (-0400) Subject: tools: allow spaces in dentries for first-damage.sh X-Git-Tag: v18.0.0~1^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=acab0766e5fd7beec3b6cec2fb2cbad59d39236c;p=ceph-ci.git tools: allow spaces in dentries for first-damage.sh Fixes: https://tracker.ceph.com/issues/57586 Signed-off-by: Patrick Donnelly --- diff --git a/src/tools/cephfs/first-damage.sh b/src/tools/cephfs/first-damage.sh index db50e8bdb0c..29e233c4387 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" }