<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000066" bgcolor="#ffffcc">
<tt>Tristan,<br>
<br>
I don't remember who gave me this to test. I made a few changes to it,
but still need a little more.. Good catch. I'll make the changes.<br>
</tt>
<pre class="moz-signature" cols="72">Regards,

Marcos Eduardo Matsunaga

Oracle USA
Linux Engineering

“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”
</pre>
<br>
On 06/03/2010 10:53 PM, tristan wrote:
<blockquote cite="mid:4C086AB2.4030107@oracle.com" type="cite">Marcos
Matsunaga wrote:
  <br>
  <blockquote type="cite">- Added execution to the config.sh script.
    <br>
    <br>
Signed-off-by: Marcos Matsunaga <a class="moz-txt-link-rfc2396E" href="mailto:Marcos.Matsunaga@oracle.com">&lt;Marcos.Matsunaga@oracle.com&gt;</a>
    <br>
---
    <br>
 programs/fill_verify_holes/Makefile   |    2 +
    <br>
 programs/fill_verify_holes/burn-in.sh |   59
++++++++++++++++++++++++++++++++-
    <br>
 2 files changed, 60 insertions(+), 1 deletions(-)
    <br>
    <br>
diff --git a/programs/fill_verify_holes/Makefile
b/programs/fill_verify_holes/Makefile
    <br>
index d0d53ae..9771542 100644
    <br>
--- a/programs/fill_verify_holes/Makefile
    <br>
+++ b/programs/fill_verify_holes/Makefile
    <br>
@@ -8,6 +8,8 @@ CFLAGS = -O2 -Wall -g $(OCFS2_CFLAGS)
    <br>
 
    <br>
 SOURCES = fill_holes.c punch_holes.c verify_holes.c fill_holes.h
reservations.h
    <br>
 
    <br>
+SUBDIR = fill_holes_data
    <br>
+
    <br>
  </blockquote>
  <br>
Oh,
  <br>
  <br>
Here I guess you want to install subdir 'fill_holes_data' into desired
postion(DESTDIR/workfiles/), right?
  <br>
  <br>
So please use SUBDIRS, makefile rules didn't recognize SUBDIR:)
  <br>
  <br>
SUBDIRS = fill_holes_data
  <br>
  <br>
What's more, you're also required to make a new directory called
'fill_holes_data' under 'programs/fill_verify_holes', and place a
makefile inside:
  <br>
--------------------------------------------------------------
  <br>
TOPDIR = ../../..
  <br>
  <br>
include $(TOPDIR)/Preamble.make
  <br>
  <br>
DATADIR = fill_holes_data
  <br>
  <br>
include $(TOPDIR)/Postamble.make
  <br>
--------------------------------------------------------------
  <br>
  <br>
That's all what you really want, I bet:)
  <br>
  <br>
  <blockquote type="cite"> DIST_FILES = $(SOURCES)
    <br>
 
    <br>
 BIN_EXTRA = burn-in.sh old_burn-in.sh fill_verify_holes.sh
    <br>
diff --git a/programs/fill_verify_holes/burn-in.sh
b/programs/fill_verify_holes/burn-in.sh
    <br>
index 1ee2b02..0ae25e7 100755
    <br>
--- a/programs/fill_verify_holes/burn-in.sh
    <br>
+++ b/programs/fill_verify_holes/burn-in.sh
    <br>
@@ -9,15 +9,28 @@ SUDO="`which sudo` -u root"
    <br>
 DEBUGFS_BIN="`which sudo` -u root `which debugfs.ocfs2`"
    <br>
 MKFS_BIN="`which sudo` -u root `which mkfs.ocfs2`"
    <br>
 TUNEFS_BIN="`which sudo` -u root `which tunefs.ocfs2`"
    <br>
+MOUNTED_BIN="`which sudo` -u root `which mounted.ocfs2`"
    <br>
 GREP=`which grep`
    <br>
+CHOWN=`which chown`
    <br>
 DF=`which df`
    <br>
+WC=`which wc`
    <br>
 ECHO="`which echo` -e"
    <br>
 AWK=`which awk`
    <br>
 
    <br>
+USERID=`/usr/bin/whoami`
    <br>
 BINPATH="."
    <br>
 LOGPATH="."
    <br>
 MMAPOPT=
    <br>
-UNWOPT=
    <br>
+if [ `dirname ${0}` == '.' ]; then
    <br>
+    if [ -f config.sh ]; then
    <br>
+        . ./config.sh;
    <br>
+    fi;
    <br>
+else
    <br>
+    if [ -f `dirname ${0}`/config.sh ]; then
    <br>
+        . `dirname ${0}`/config.sh
    <br>
+    fi;
    <br>
+fi;
    <br>
  </blockquote>
  <br>
why need to judge [ `dirname ${0}` == '.' ] ?
  <br>
  <br>
I saw no difference if you directly use:
  <br>
  <br>
+    if [ -f `dirname ${0}`/config.sh ]; then
  <br>
+        . `dirname ${0}`/config.sh
  <br>
+    fi;
  <br>
  <br>
  <br>
  <blockquote type="cite">+NWOPT=
    <br>
 
    <br>
 log_run() {
    <br>
     echo "Run: $@"
    <br>
@@ -66,6 +79,48 @@ run100() {
    <br>
     done
    <br>
 }
    <br>
 
    <br>
+Run_corruption() {
    <br>
+    CORRUPTLOG=${O2TDIR}/workfiles/fill_holes_data/nosparsebug.dat
    <br>
+    FILESIZE=$[11*1024*1024*1024];
    <br>
+    FILENAME=${DIRECTORY}/fill_holes.txt;
    <br>
+    FS_FEATURES='--fs-features=nosparse,nounwritten'
    <br>
+    LOCAL_FEATURE=''
    <br>
+    if [ ${LOCALFLAG} -eq 1 ]; then
    <br>
+        LOCAL_FEATURE='-M local';
    <br>
+    fi;
    <br>
+    echo -e "Testing corruption";
    <br>
+    mounted=`mount|grep ${MOUNTPOINT}|${WC} -l`;
    <br>
+    if [ ${mounted} -eq 1 ]; then
    <br>
+        echo -e "umounting partition";
    <br>
+        sudo umount ${MOUNTPOINT};
    <br>
+    fi;
    <br>
+    mounted=`mount|grep ${MOUNTPOINT}|${WC} -l`;
    <br>
+    if [ ${mounted} -ne 0 ]; then
    <br>
+        echo -e "Device ${DEVICE} is mounted by some other node.";
    <br>
+        echo -e "Can't proceed with this test. Aborting.";
    <br>
+        exit 1;
    <br>
+    fi;
    <br>
+    echo "Formatting partition with nosparse,nounwritten options.";
    <br>
+    echo "y"|${MKFS_BIN} -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -L ${LABEL}
\
    <br>
+    -N ${SLOTS} ${LOCAL_FEATURE} ${FS_FEATURES} ${DEVICE};
    <br>
+    if [ $? -ne 0 ]; then
    <br>
+        echo -e "mkfs.ocfs2 failed $?";
    <br>
  </blockquote>
  <br>
Shouldn't we quit the test if mkfs failed?
  <br>
  <br>
  <blockquote type="cite">+    fi;
    <br>
+    echo "mounting device with label ${LABEL} on ${MOUNTPOINT}";
    <br>
+    sudo mount LABEL=${LABEL} ${MOUNTPOINT};
    <br>
+    sudo mkdir -p ${DIRECTORY}
    <br>
+    ${SUDO} ${CHOWN} --recursive ${USERID} ${MOUNTPOINT}
    <br>
+
    <br>
+    mounted=`mount|grep ${MOUNTPOINT}|${WC} -l`;
    <br>
+    if [ ${mounted} -eq 0 ]; then
    <br>
+        echo -e "Device ${DEVICE} was not properly mounted.";
    <br>
+        echo -e "Can't proceed with this test. Aborting.";
    <br>
+        exit 1;
    <br>
+    fi;
    <br>
+    ${BINDIR}/fill_holes  -r ${CORRUPTLOG} ${FILENAME} ${FILESIZE};
    <br>
+    ${BINDIR}/verify_holes ${CORRUPTLOG} ${FILENAME};
    <br>
+}
    <br>
+
    <br>
 #
    <br>
 # GetDevInfo
    <br>
 #
    <br>
@@ -88,6 +143,7 @@ LABEL=`${DEBUGFS_BIN} -R stats ${DEVICE} | grep
Label:|\
    <br>
 if [ "X${LABEL}" == "X" ]; then
    <br>
     LABEL="testlabel";
    <br>
 fi;
    <br>
+LOCALFLAG=`${DEBUGFS_BIN} -R stats ${DEVICE} | grep 'local' |${WC} -l`
    <br>
  </blockquote>
  <br>
I guess you want to judge if 'local features' was set on superblock.
  <br>
  <br>
But please don't make the decision by arbitrarily counting the number
of lines where 'local' was seen, in case we may add other output for
debugfs.ocfs which contains 'local' string, following way could be more
graceful and exact:
  <br>
  <br>
${DEBUGFS_BIN} -R "stats" ${DEVICE}|grep "Feature Incompat"|grep -q
'local'
  <br>
LOCALFLAG=$?
  <br>
  <br>
thing was different a little bit, here 'LOCALFLAG == 0' denotes that
we've set local features on SB.
  <br>
  <br>
  <br>
  <blockquote type="cite"> UUID=`${DEBUGFS_BIN} -R stats ${DEVICE} |
grep UUID|\
    <br>
     ${AWK} -F" " '{print $2}'`;
    <br>
 SLOTS=`${DEBUGFS_BIN} -R stats ${DEVICE} | grep Slots:|\
    <br>
@@ -122,3 +178,4 @@ fi
    <br>
 
    <br>
 GetDevInfo;
    <br>
 run100 ${ITER} ${SIZE} +Run_corruption
    <br>
  </blockquote>
Btw, I trusted you on the logics of newly added testcase:)
  <br>
  <br>
  <br>
Tristan.
  <br>
</blockquote>
</body>
</html>