Blame tests/rgrifieldscheck.sh
|
Packit Service |
360c39 |
#!/bin/sh
|
|
Packit Service |
360c39 |
dev=$1
|
|
Packit Service |
360c39 |
i=0
|
|
Packit Service |
360c39 |
gfs2_edit -p rg 0 $dev | grep rg_data0 > /dev/null 2>&1
|
|
Packit Service |
360c39 |
# New fields not present in /usr/include/linux/gfs2_ondisk.h
|
|
Packit Service |
360c39 |
test $? = 0 || exit 0
|
|
Packit Service |
360c39 |
gfs2_edit -p rindex $dev | while read field rival unused
|
|
Packit Service |
360c39 |
do
|
|
Packit Service |
360c39 |
test $field = ri_data0 -o $field = ri_data -o $field = ri_bitbytes || continue
|
|
Packit Service |
360c39 |
rgfield=$(echo $field | sed 's/ri/rg/')
|
|
Packit Service |
360c39 |
rgval=$(gfs2_edit -p rg $i $dev | grep " $rgfield " | awk '{print $2}')
|
|
Packit Service |
360c39 |
|
|
Packit Service |
360c39 |
if test "$rival" != "$rgval"
|
|
Packit Service |
360c39 |
then
|
|
Packit Service |
360c39 |
echo "Bad $rgfield in rg $i: $rgval (expected: $rival)" >&2
|
|
Packit Service |
360c39 |
exit 1
|
|
Packit Service |
360c39 |
fi
|
|
Packit Service |
360c39 |
|
|
Packit Service |
360c39 |
test $field = ri_bitbytes && let i++
|
|
Packit Service |
360c39 |
done
|