[Ocfs2-test-devel] [PATCH 1/3] ocfs2-test: mkfs-test.sh - Made script compatible with new debugfs.ocfs2 output.

Sunil Mushran sunil.mushran at oracle.com
Fri May 29 13:31:40 PDT 2009


Marcos Matsunaga wrote:
> Debugfs.ocfs2 had some changes on the way it displays the output.
> This change makes it compatible with the new output. Also, due to the
> change on the way it reports some information (it now reports the size
> and not the bits), the calculation of blocksize and clustersize is not
> necessary anymore.  The calculation was removed and the comparison is
> now made directly to the results obtained from debugfs.ocfs2.
>
> Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga at oracle.com>
> ---
>  programs/mkfs-tests/mkfs-test.sh |   14 ++++++--------
>  1 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh
> index 51d61be..4db63d6 100755
> --- a/programs/mkfs-tests/mkfs-test.sh
> +++ b/programs/mkfs-tests/mkfs-test.sh
> @@ -24,9 +24,9 @@ verify_sizes() {
>  
>      ${DEBUGFS} -R "stats" ${device} >> ${O} 2>/dev/null
>  
> -    num1=`${AWK} '/Block Size Bits/ {print $4;}' ${O}`
> -    num2=`${AWK} '/Cluster Size Bits/ {print $8;}' ${O}`
> -    num3=`${AWK} '/Clusters:/ {print $4;}' ${O}`
> +    num1=`${AWK} '/Block size=/ {print $2;}' ${O}|cut -f2 -d"="`
> +    num2=`${AWK} '/Cluster size=/ {print $2;}' ${O}|cut -f2 -d"="`
> +    num3=`${AWK} '/Volume size=/ {print $3;}' ${O}|cut -f2 -d"("`
>   

Where do you see this? Are you running the current debugfs?

# debugfs.ocfs2 -V
debugfs.ocfs2 1.4.2
# debugfs.ocfs2 -R "stats" /dev/sda1
    Revision: 0.90
    Mount Count: 0   Max Mount Count: 20
    State: 0   Errors: 0
    Check Interval: 0   Last Check: Tue May 19 19:35:15 2009
    Creator OS: 0
    Feature Compat: 1 backup-super
    Feature Incompat: 0
    Tunefs Incomplete: 0
    Feature RO compat: 0
    Root Blknum: 5   System Dir Blknum: 6
    First Cluster Group Blknum: 3
    Block Size Bits: 12   Cluster Size Bits: 12
    Max Node Slots: 8
    Extended Attributes Inline Size: 0
    Label: ocfs2vol
    UUID: 84044D1EFFFD433092C63486CAB85C0F
    UUID_hash: 0 (0x0)
    Cluster stack: classic o2cb
    Inode: 2   Mode: 00   Generation: 2873114974 (0xab40415e)
    FS Generation: 2873114974 (0xab40415e)
    CRC32: 00000000   ECC: 0000
    Type: Unknown   Attr: 0x0   Flags: Valid System Superblock
    Dynamic Features: (0x0)
    User: 0 (root)   Group: 0 (root)   Size: 0
    Links: 0   Clusters: 13107196
    ctime: 0x48600673 -- Mon Jun 23 13:24:19 2008
    atime: 0x0 -- Wed Dec 31 16:00:00 1969
    mtime: 0x48600673 -- Mon Jun 23 13:24:19 2008
    dtime: 0x0 -- Wed Dec 31 16:00:00 1969
    ctime_nsec: 0x00000000 -- 0
    atime_nsec: 0x00000000 -- 0
    mtime_nsec: 0x00000000 -- 0
    Last Extblk: 0
    Sub Alloc Slot: Global   Sub Alloc Bit: 65535

>  
>      if [ ${num1} -eq 0 ] || [ ${num2} -eq 0 ] || [ ${num3} -eq 0 ]
>      then
> @@ -34,17 +34,15 @@ verify_sizes() {
>          exit 1
>      fi
>  
> -    b=$[$[2**$[${num1} - 9]]*512]
> -    c=$[$[2**$[${num2} - 9]]*512]
> -    v=$[${num3} * ${c}/${b}]
> +    v=$[${num3} * ${num2}/${num1}]
>  
>       echo -n "verify ..... "  |tee -a ${LOGFILE}
>  
> -    if [ ${B} -ne ${b} ]; then
> +    if [ ${B} -ne ${num1} ]; then
>          echo "ERROR: Blocksize mismatch - found ${b}, expected ${B}" >> ${O}
>          RET=1
>      fi
> -    if [ ${C} -ne ${c} ]; then
> +    if [ ${C} -ne ${num2} ]; then
>          echo "ERROR: Clustersize mismatch - found ${c}, expected ${C}" >> ${O}
>          RET=1
>      fi
>   




More information about the Ocfs2-test-devel mailing list