gfs2-utils/tests/rgskipcheck.sh
Petr Šabata 7dc3f909e5 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/gfs2-utils#01606e25fc1dc289800b53ef29011db23f0b72b9
2020-10-15 00:53:18 +02:00

20 lines
504 B
Bash
Executable File

#!/bin/sh
dev=$1
rgcount=$(gfs2_edit -p rgcount $dev | cut -f1 -d' ')
prevaddr=$(gfs2_edit -p rg 0 $dev | grep ^RG | awk '{print $5}')
prevskip=0
for i in `seq 0 $(($rgcount - 1))`; do
addr=$(gfs2_edit -p rg $i $dev | grep ^RG | awk '{print $5}')
expected=$(($addr - $prevaddr))
if test $prevskip != $expected; then
echo "Bad rg_skip in rg $(($i - 1)): $prevskip (expected: $expected)" >&2
exit 1
fi
prevskip=$(gfs2_edit -p rg $i $dev | grep rg_skip | awk '{print $2}')
prevaddr=$addr
done