Re: [Ocfs2-devel] [PATCH 1/7] ocfs2: test reflinking to inline data files

2016-12-12 Thread Darrick J. Wong
On Tue, Dec 13, 2016 at 11:20:57AM +0800, Eryu Guan wrote:
> On Mon, Dec 12, 2016 at 10:09:22AM -0800, Darrick J. Wong wrote:
> > On Mon, Dec 12, 2016 at 05:01:20PM +0800, Eryu Guan wrote:
> > > On Sun, Dec 11, 2016 at 01:52:51PM -0800, Darrick J. Wong wrote:
> > > > Make sure that we can handle reflinking from and to inline-data files.
> > > > 
> > > > Signed-off-by: Darrick J. Wong 
> > > > ---
> > > >  common/reflink   |2 +
> > > >  tests/ocfs2/001  |   88 
> > > > ++
> > > >  tests/ocfs2/001.out  |   14 
> > > >  tests/ocfs2/Makefile |   20 +++
> > > >  tests/ocfs2/group|1 +
> > > >  5 files changed, 124 insertions(+), 1 deletion(-)
> > > >  create mode 100755 tests/ocfs2/001
> > > >  create mode 100644 tests/ocfs2/001.out
> > > >  create mode 100644 tests/ocfs2/Makefile
> > > >  create mode 100644 tests/ocfs2/group
> > > > 
> > > > 
> > > > diff --git a/common/reflink b/common/reflink
> > > > index 9d51729..d048045 100644
> > > > --- a/common/reflink
> > > > +++ b/common/reflink
> > > > @@ -197,7 +197,7 @@ _cp_reflink() {
> > > > file1="$1"
> > > > file2="$2"
> > > >  
> > > > -   cp --reflink=always -p "$file1" "$file2"
> > > > +   cp --reflink=always -p -f "$file1" "$file2"
> > > 
> > > I'm still seeing "File exists" error with this patch, tested with your
> > > ocfs2-vfs-reflink-6 branch, compiled on openSUSE Tumbleweed.
> > > 
> > > FSTYP -- ocfs2
> > > PLATFORM  -- Linux/x86_64 bootp-73-5-234 4.9.0-rc8.djwong-ocfs2+
> > > MKFS_OPTIONS  -- --fs-features=local /dev/sda5
> > > MOUNT_OPTIONS -- /dev/sda5 /mnt/testarea/scratch
> > > 
> > > ocfs2/001- output mismatch (see 
> > > /root/xfstests/results//ocfs2/ocfs2/001.out.bad)
> > > --- tests/ocfs2/001.out 2016-12-12 13:51:38.053909486 +0800
> > > +++ /root/xfstests/results//ocfs2/ocfs2/001.out.bad 2016-12-12 
> > > 16:49:35.038882697 +0800
> > > @@ -1,14 +1,18 @@
> > >  QA output created by 001
> > > +mkfs.ocfs2 1.8.4
> > 
> > I guess I'll have to neuter this on newer ocfs2-tools.  (Still running 1.6.4
> > here).
> 
> I have a patch pending on review that could fix & filter this, FYI
> 
> fstests: teach _scratch_mkfs to handle mkfs option conflicts
> https://www.spinics.net/lists/fstests/msg04550.html

 I actually meant the printing of the mkfs version string.

> 
> > 
> > >  Format and mount
> > >  Create the original files
> > >  reflink into the start of file2
> > > +cp: failed to reflink '/mnt/testarea/scratch/test-001/file2' from 
> > > '/mnt/testarea/scratch/test-001/file1': File exists
> > >  reflink past the stuff in file3
> > > ...
> > > (Run 'diff -u tests/ocfs2/001.out 
> > > /root/xfstests/results//ocfs2/ocfs2/001.out.bad'  to see the entire diff)
> > > 
> > > --- tests/ocfs2/001.out 2016-12-12 13:51:38.053909486 +0800
> > > +++ /root/xfstests/results//ocfs2/ocfs2/001.out.bad 2016-12-12 
> > > 16:44:31.991943842 +0800
> > > @@ -1,14 +1,18 @@
> > >  QA output created by 001
> > > +mkfs.ocfs2 1.8.4
> > >  Format and mount
> > >  Create the original files
> > >  reflink into the start of file2
> > > +cp: failed to reflink '/mnt/testarea/scratch/test-001/file2' from 
> > > '/mnt/testarea/scratch/test-001/file1': File exists
> > >  reflink past the stuff in file3
> > >  reflink an inline-data file to a regular one
> > > +cp: failed to reflink '/mnt/testarea/scratch/test-001/file5' from 
> > > '/mnt/testarea/scratch/test-001/file4': File exists
> > >  reflink an inline-data file to another inline-data file
> > > +cp: failed to reflink '/mnt/testarea/scratch/test-001/file6' from 
> > > '/mnt/testarea/scratch/test-001/file4': File exists
> > >  Verify the whole mess
> > >  2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-001/file1
> > > -2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-001/file2
> > > +401b30e3b8b5d629635a5c613cdb7919  SCRATCH_MNT/test-001/file2
> > >  4e68a2e24b6b0f386ab39d01d902293d  SCRATCH_MNT/test-001/file3
> > >  009520053b00386d1173f3988c55d192  SCRATCH_MNT/test-001/file4
> > > -009520053b00386d1173f3988c55d192  SCRATCH_MNT/test-001/file5
> > > -009520053b00386d1173f3988c55d192  SCRATCH_MNT/test-001/file6
> > > +2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-001/file5
> > > +60b725f10c9c85c70d97880dfe8191b3  SCRATCH_MNT/test-001/file6
> > > 
> > > I did the "reflink into the start of file2" test manually, and strace
> > > showed that it is file1 reports EEXIST.
> > > 
> > > open("/mnt/ocfs2/testfile1", O_RDONLY)  = 3
> > > fstat(3, {st_mode=S_IFREG|0600, st_size=65536, ...}) = 0
> > > ioctl(3, _IOC(_IOC_WRITE, 0x6f, 0x04, 0x18), 0x7ffc8daf09f0) = -1 EEXIST 
> > > (File exists)
> > 
> > Wait, that's the ocfs2 reflink ioctl, not FICLONE.  Well that explains
> > why the functional parts of the tests fail.  I looked at latest coreutils
> > source, which does not use OCFS2_IOC_REFLINK, so I guess this must be an
> > opensuse thing?
> 
> Ok,

[Ocfs2-devel] [PATCH 16/17] inline data: fix build error

2016-12-12 Thread Eric Ren
Signed-off-by: Eric Ren 
---
 programs/defrag-test/frager.c | 2 +-
 programs/directio_test/directio_test.c| 2 +-
 programs/discontig_bg_test/spawn_inodes.c | 2 +-
 programs/dx_dirs_tests/index_dir.c| 2 +-
 programs/inline-data/inline-data.c| 2 +-
 programs/inline-data/inline-dirs.c| 2 +-
 programs/reflink_tests/reflink_test.c | 2 +-
 programs/xattr_tests/xattr-test.c | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/programs/defrag-test/frager.c b/programs/defrag-test/frager.c
index f510dde..473c31c 100755
--- a/programs/defrag-test/frager.c
+++ b/programs/defrag-test/frager.c
@@ -86,7 +86,7 @@ static int usage(void)
 static void sigchld_handler()
 {
pid_t   pid;
-   union wait status;
+   int status;
 
while (1) {
pid = wait3(&status, WNOHANG, NULL);
diff --git a/programs/directio_test/directio_test.c 
b/programs/directio_test/directio_test.c
index 7ec5278..21bc32c 100755
--- a/programs/directio_test/directio_test.c
+++ b/programs/directio_test/directio_test.c
@@ -214,7 +214,7 @@ static int teardown(void)
 static void sigchld_handler()
 {
pid_t pid;
-   union wait status;
+   int status;
 
while (1) {
pid = wait3(&status, WNOHANG, NULL);
diff --git a/programs/discontig_bg_test/spawn_inodes.c 
b/programs/discontig_bg_test/spawn_inodes.c
index 6bb7a93..633f0a9 100755
--- a/programs/discontig_bg_test/spawn_inodes.c
+++ b/programs/discontig_bg_test/spawn_inodes.c
@@ -64,7 +64,7 @@ static int usage(void)
 static void sigchld_handler()
 {
pid_t   pid;
-   union wait status;
+   int status;
 
while (1) {
pid = wait3(&status, WNOHANG, NULL);
diff --git a/programs/dx_dirs_tests/index_dir.c 
b/programs/dx_dirs_tests/index_dir.c
index 75ea8bd..ffdfa0f 100755
--- a/programs/dx_dirs_tests/index_dir.c
+++ b/programs/dx_dirs_tests/index_dir.c
@@ -926,7 +926,7 @@ void random_test(void)
 static void sigchld_handler()
 {
 pid_t pid;
-union wait status;
+int status;
 
 while (1) {
 pid = wait3(&status, WNOHANG, NULL);
diff --git a/programs/inline-data/inline-data.c 
b/programs/inline-data/inline-data.c
index 13124d7..daaee3c 100644
--- a/programs/inline-data/inline-data.c
+++ b/programs/inline-data/inline-data.c
@@ -256,7 +256,7 @@ static int teardown(void)
 static void sigchld_handler()
 {
pid_t pid;
-   union wait status;
+   int status;
 
while (1) {
pid = wait3(&status, WNOHANG, NULL);
diff --git a/programs/inline-data/inline-dirs.c 
b/programs/inline-data/inline-dirs.c
index ac7882f..0db24b9 100644
--- a/programs/inline-data/inline-dirs.c
+++ b/programs/inline-data/inline-dirs.c
@@ -357,7 +357,7 @@ static void run_large_dir_tests(void)
 static void sigchld_handler()
 {
pid_t pid;
-   union wait status;
+   int status;
 
while (1) {
pid = wait3(&status, WNOHANG, NULL);
diff --git a/programs/reflink_tests/reflink_test.c 
b/programs/reflink_tests/reflink_test.c
index 22386db..2801968 100755
--- a/programs/reflink_tests/reflink_test.c
+++ b/programs/reflink_tests/reflink_test.c
@@ -965,7 +965,7 @@ static int stress_test()
 static void sigchld_handler()
 {
pid_t pid;
-   union wait status;
+   int status;
 
while (1) {
pid = wait3(&status, WNOHANG, NULL);
diff --git a/programs/xattr_tests/xattr-test.c 
b/programs/xattr_tests/xattr-test.c
index d204aba..77be780 100755
--- a/programs/xattr_tests/xattr-test.c
+++ b/programs/xattr_tests/xattr-test.c
@@ -301,7 +301,7 @@ static void judge_sys_return(int ret, const char *sys_func)
 static void sigchld_handler()
 {
pid_t   pid;
-   union wait status;
+   int status;
while (1) {
pid = wait3(&status, WNOHANG, NULL);
if (pid <= 0)
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 15/17] Handle the case when a symbolic link device is given

2016-12-12 Thread Eric Ren
It's a usual case that the shared disk is given in symbolic
name, like iscsi disk "/dev/disk/by-path/disk". So work out
the typical device name in such case.

Signed-off-by: Eric Ren 
---
 programs/discontig_bg_test/discontig_runner.sh |  5 +
 programs/python_common/multiple_run.sh | 13 +
 programs/python_common/single_run-WIP.sh   |  6 ++
 3 files changed, 24 insertions(+)

diff --git a/programs/discontig_bg_test/discontig_runner.sh 
b/programs/discontig_bg_test/discontig_runner.sh
index 4c13adb..182ca3a 100755
--- a/programs/discontig_bg_test/discontig_runner.sh
+++ b/programs/discontig_bg_test/discontig_runner.sh
@@ -126,6 +126,11 @@ function f_setup()
if [ -z "${DEVICE}" ];then
f_usage
fi  
+
+   # if a symbollink is given, work out the typical device name, like 
/dev/sda
+   if [ -L ${DEVICE} ];then
+   DEVICE=`readlink -f ${DEVICE}`
+   fi

if [ -z "${MOUNT_POINT}" ];then
f_usage
diff --git a/programs/python_common/multiple_run.sh 
b/programs/python_common/multiple_run.sh
index 74c3531..3e11abd 100755
--- a/programs/python_common/multiple_run.sh
+++ b/programs/python_common/multiple_run.sh
@@ -135,6 +135,19 @@ f_setup()
 
f_getoptions $*
 
+   if [ -z ${DEVICE} ] ; then
+   ${ECHO} "ERROR: No device"
+   f_usage
+   elif [ ! -b ${DEVICE} ] ; then
+   ${ECHO} "ERROR: Invalid device ${DEVICE}"
+   exit 1
+   fi
+
+   # if a symbollink is given, work out the typical device name, like 
/dev/sda
+   if [ -L ${DEVICE} ];then
+DEVICE=`readlink -f ${DEVICE}`
+   fi
+
if [ -z "${MOUNT_POINT}" ];then
 f_usage
 fi
diff --git a/programs/python_common/single_run-WIP.sh 
b/programs/python_common/single_run-WIP.sh
index 5c174f0..92d1216 100755
--- a/programs/python_common/single_run-WIP.sh
+++ b/programs/python_common/single_run-WIP.sh
@@ -1095,6 +1095,7 @@ do
?) usage;;
esac
 done
+
 if [ -z ${DEVICE} ] ; then
${ECHO} "ERROR: No device"
usage
@@ -1103,6 +1104,11 @@ elif [ ! -b ${DEVICE} ] ; then
exit 1
 fi
 
+# if a symbollink is given, work out the typical device name, like /dev/sda
+if [ -L ${DEVICE} ];then
+   DEVICE=`readlink -f ${DEVICE}`
+fi
+
 if [ -z ${MOUNTPOINT} ] ; then
${ECHO} "ERROR: No mountpoint"
usage
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 10/17] Multiple run: make blocksize and clustersize as parameters

2016-12-12 Thread Eric Ren
It takes too long to get the result of a round testing. This
can shorten a lot time by eliminating 2-layer loops with blocksize
and clustersize. Now blocksize defaults to 4096, while clustersize
to 32768 if not specified.

Signed-off-by: Eric Ren 
---
 programs/inline-data/multi-inline-run.sh | 24 
 programs/python_common/multiple_run.sh   | 28 +++-
 programs/reflink_tests/multi_reflink_test_run.sh | 28 ++--
 programs/xattr_tests/xattr-multi-run.sh  | 24 
 4 files changed, 83 insertions(+), 21 deletions(-)

diff --git a/programs/inline-data/multi-inline-run.sh 
b/programs/inline-data/multi-inline-run.sh
index 1d51443..0a2ffa5 100755
--- a/programs/inline-data/multi-inline-run.sh
+++ b/programs/inline-data/multi-inline-run.sh
@@ -126,12 +126,14 @@ exit_or_not()
 

 f_usage()
 {
-echo "usage: `basename ${0}` [-r MPI_ranks] <-f MPI_hosts> [-a 
access_method] [-o output] <-d > "
+echo "usage: `basename ${0}` [-r MPI_ranks] <-f MPI_hosts> [-a 
access_method] [-o output] <-d > <-b blocksize> -c  
"
 echo "   -r size of MPI rank"
 echo "   -a access method for process propagation,should be ssh or 
rsh,set ssh as a default method when omited."
 echo "   -f MPI hosts list,separated by comma,e.g -f 
node1.us.oracle.com,node2.us.oracle.com."
 echo "   -o output directory for the logs"
 echo "   -d device name used for ocfs2 volume"
+echo "  -b block size"
+echo "  -c cluster size"
 echo "path of mountpoint where the ocfs2 volume 
will be mounted on."
 exit 1;
 
@@ -144,13 +146,15 @@ f_getoptions()
 exit 1
  fi
 
- while getopts "o:hd:r:a:f:" options; do
+ while getopts "o:hd:r:a:f:b:c:" options; do
 case $options in
a ) MPI_ACCESS_METHOD="$OPTARG";;
r ) MPI_RANKS="$OPTARG";;
f ) MPI_HOSTS="$OPTARG";;
 o ) LOG_OUT_DIR="$OPTARG";;
 d ) OCFS2_DEVICE="$OPTARG";;
+   b ) BLOCKSIZE="$OPTARG";;
+   c ) CLUSTERSIZE="$OPTARG";;
 h ) f_usage
 exit 1;;
 * ) f_usage
@@ -327,9 +331,21 @@ trap ' : ' SIGTERM
 
 f_setup $*
 
-for BLOCKSIZE in 512 1024 4096
+if [ -n "$BLOCKSIZE" ];then
+   bslist="$BLOCKSIZE"
+else
+   bslist="512 1024 4096"
+fi
+
+if [ -n "CLUSTERSIZE" ];then
+   cslist="$CLUSTERSIZE"
+else
+   cslist="4096 32768 1048576"
+fi
+
+for BLOCKSIZE in $(echo "$bslist")
 do
-   for CLUSTERSIZE in  4096 32768 1048576
+   for CLUSTERSIZE in $(echo "$cslist")
do
echo "++Multiple node inline-data test with \"-b 
${BLOCKSIZE} -C ${CLUSTERSIZE}\"++" |tee -a ${RUN_LOG_FILE}
echo "++Multiple node inline-data test with \"-b 
${BLOCKSIZE} -C ${CLUSTERSIZE}\"++">>${DATA_LOG_FILE}
diff --git a/programs/python_common/multiple_run.sh 
b/programs/python_common/multiple_run.sh
index 9e2237a..b2d5800 100755
--- a/programs/python_common/multiple_run.sh
+++ b/programs/python_common/multiple_run.sh
@@ -72,10 +72,12 @@ set -o pipefail
 

 f_usage()
 {
-echo "usage: `basename ${0}` <-k kerneltarball> <-n nodes> [-i nic] \
+echo "usage: `basename ${0}` <-k kerneltarball> [-b blocksize] [-c 
clustersize] <-n nodes> [-i nic] \
 [-a access_method] [-o logdir] <-d device> [-t testcases] "
 echo "   -k kerneltarball should be path of tarball for kernel src."
 echo "   -n nodelist,should be comma separated."
+echo "   -b blocksize."
+echo "   -c clustersize."
 echo "   -o output directory for the logs"
 echo "   -i network interface name to be used for MPI messaging."
 echo "   -a access method for mpi execution,should be ssh or rsh"
@@ -97,13 +99,15 @@ f_getoptions()
exit 1
fi
 
-   while getopts "n:d:i:a:o:k:t:h:" options; do
+   while getopts "n:d:i:a:o:b:c:k:t:h:" options; do
case $options in
n ) NODE_LIST="$OPTARG";;
d ) DEVICE="$OPTARG";;
i ) INTERFACE="$OPTARG";;
a ) ACCESS_METHOD="$OPTARG";;
o ) LOG_DIR="$OPTARG";;
+   b ) BLOCKSIZE="$OPTARG";;
+   c ) CLUSTERSIZE="$OPTARG";;
k ) KERNELSRC="$OPTARG";;
t ) TESTCASES="$OPTARG";;
h ) f_usage
@@ -359,7 +363,7 @@ run_xattr_test()
 
LogRunMsg "xattr-test"
${BINDIR}/xattr-multi-run.sh -r 4 -f ${NODE_LIST} -a ssh -o ${logdir} \
--d ${DEVICE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1
+-d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} ${MOUNT_POINT} >> ${LOGFILE} 
2>&1
LogRC $?
 }
 
@@ -369,7

[Ocfs2-devel] [PATCH 11/17] discontig bg: make blocksize and clustersize as parameters

2016-12-12 Thread Eric Ren
Add "-b blocksize" and "-c clustersize" as optional parameters.
It will keep the original behavior if we don't specify their
values.

Signed-off-by: Eric Ren 
---
 programs/discontig_bg_test/discontig_runner.sh | 51 +-
 1 file changed, 33 insertions(+), 18 deletions(-)

diff --git a/programs/discontig_bg_test/discontig_runner.sh 
b/programs/discontig_bg_test/discontig_runner.sh
index bb6a53e..1d94be3 100755
--- a/programs/discontig_bg_test/discontig_runner.sh
+++ b/programs/discontig_bg_test/discontig_runner.sh
@@ -64,7 +64,8 @@ MPI_BTL_IF_ARG=
 

 function f_usage()
 {
-echo "usage: `basename ${0}` <-d device> [-o logdir] [-m multi_hosts] [-a 
access_method] "
+echo "usage: `basename ${0}` <-d device> [-o logdir] [-m multi_hosts] [-a 
access_method] \
+[-b block_size] [-c cluster_size] "
 exit 1;
 
 }
@@ -76,13 +77,15 @@ function f_getoptions()
exit 1
fi

-   while getopts "hd:o:m:a:" options; do
+   while getopts "hd:o:m:a:b:c:" options; do
case $options in
d ) DEVICE="$OPTARG";;
o ) LOG_DIR="$OPTARG";;
a ) MPI_ACCESS_METHOD="$OPTARG";;
m ) MULTI_TEST=1
MPI_HOSTS="$OPTARG";;
+b ) BLOCKSIZE="$OPTARG";;
+c ) CLUSTERSIZE="$OPTARG";;
h ) f_usage
exit 1;;
* ) f_usage
@@ -209,7 +212,7 @@ function f_inodes_test()
local filename=
 
f_LogMsg ${LOG_FILE} "Activate inode discontig-bg on ${DEVICE}"
-   ${DISCONTIG_ACTIVATE_BIN} -t inode -r 200 -b $BLOCKSIZE -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} ${MOUNT_POINT} 
>>${LOG_FILE} 2>&1
+   ${DISCONTIG_ACTIVATE_BIN} -t inode -r 200 -b ${BLOCKSIZE} -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} ${MOUNT_POINT} 
>>${LOG_FILE} 2>&1
RET=$?
f_exit_or_not ${RET}
 
@@ -292,7 +295,7 @@ function f_inodes_test()
f_exit_or_not ${RET}
 
f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}"
-   ${DISCONTIG_ACTIVATE_BIN} -t inode -r 4096 -b $BLOCKSIZE -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
+   ${DISCONTIG_ACTIVATE_BIN} -t inode -r 4096 -b ${BLOCKSIZE} -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
RET=$?
f_exit_or_not ${RET}
 
@@ -420,7 +423,7 @@ function f_extents_test()
local inc=
 
f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}"
-   ${DISCONTIG_ACTIVATE_BIN} -t extent -r 2048 -b $BLOCKSIZE -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
+   ${DISCONTIG_ACTIVATE_BIN} -t extent -r 2048 -b ${BLOCKSIZE}-c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
RET=$?
f_exit_or_not ${RET}
 
@@ -552,7 +555,7 @@ function f_extents_test()
 function f_inline_test()
 {
f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}"
-   ${DISCONTIG_ACTIVATE_BIN} -t inode -r 1024 -b $BLOCKSIZE -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
+   ${DISCONTIG_ACTIVATE_BIN} -t inode -r 1024 -b ${BLOCKSIZE} -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
RET=$?
f_exit_or_not ${RET}
 
@@ -622,7 +625,7 @@ function f_inline_test()
 function f_xattr_test()
 {
f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}"
-   ${DISCONTIG_ACTIVATE_BIN} -t extent -r 10240 -b $BLOCKSIZE -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
+   ${DISCONTIG_ACTIVATE_BIN} -t extent -r 10240 -b ${BLOCKSIZE} -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
RET=$?
f_exit_or_not ${RET}
 
@@ -705,7 +708,7 @@ function f_refcount_test()
local inc=
 
f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}"
-   ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
+   ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} 
-c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
RET=$?
f_exit_or_not ${RET}
 
@@ -883,7 +886,7 @@ function f_refcount_test()
 function f_dxdir_test()
 {
f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}"
-   ${DISCONTIG_ACTIVATE_BIN} -t extents -r 2048 -b $BLOCKSIZE -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
+   ${DISCONTIG_ACTIVATE_BIN} -t extents -r 2048 -b ${BLOCKSIZE} -c 
${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1
RET=$?
f_exit_or_not ${RET}
 
@@ -9

[Ocfs2-devel] [PATCH 03/17] Trivial: better not to depend on where we issue testing

2016-12-12 Thread Eric Ren
If we issue testing outsides directory where executives
are, error likes the below may occur:
"./config.sh No such file or directory".
So let's depend on PATH environment rather that.

Signed-off-by: Eric Ren 
---
 programs/dirop_fileop_racer/racer.sh   | 48 +++---
 programs/dx_dirs_tests/index_dir_run.sh|  2 +-
 programs/dx_dirs_tests/multi_index_dir_run.sh  |  2 +-
 programs/inline-data/multi-inline-run.sh   |  2 +-
 programs/inline-data/single-inline-run.sh  |  2 +-
 .../inode_alloc_perf_tests/inode_alloc_perf.sh |  2 +-
 .../multi_inode_alloc_perf.sh  |  2 +-
 .../multi_inode_alloc_perf_runner.sh   |  2 +-
 .../iozone/iozone3_263/src/current/Generate_Graphs | 26 ++--
 programs/logwriter/enospc.sh   |  2 +-
 programs/logwriter/rename_write_race.sh|  2 +-
 programs/python_common/o2tf.sh |  2 +-
 programs/python_common/single_run-WIP.sh   |  4 +-
 programs/python_common/single_run.sh   |  2 +-
 .../tunefs-test/remove-slot/corrupt_remove_slot.sh |  2 +-
 programs/xattr_tests/xattr-multi-run.sh|  2 +-
 programs/xattr_tests/xattr-single-run.sh   |  2 +-
 17 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/programs/dirop_fileop_racer/racer.sh 
b/programs/dirop_fileop_racer/racer.sh
index 819efa8..7e83b7a 100755
--- a/programs/dirop_fileop_racer/racer.sh
+++ b/programs/dirop_fileop_racer/racer.sh
@@ -37,37 +37,37 @@ DIR="race"
 #
 
 [ -e $DIR ] || mkdir $DIR
-./file_create.sh $DIR $MAX_FILES &
-./file_create.sh $DIR $MAX_FILES &
-./file_create.sh $DIR $MAX_FILES &
+file_create.sh $DIR $MAX_FILES &
+file_create.sh $DIR $MAX_FILES &
+file_create.sh $DIR $MAX_FILES &
 
-./dir_create.sh $DIR $MAX_FILES &
-./dir_create.sh $DIR $MAX_FILES &
-./dir_create.sh $DIR $MAX_FILES &
+dir_create.sh $DIR $MAX_FILES &
+dir_create.sh $DIR $MAX_FILES &
+dir_create.sh $DIR $MAX_FILES &
 
-./file_rename.sh $DIR $MAX_FILES &
-./file_rename.sh $DIR $MAX_FILES &
-./file_rename.sh $DIR $MAX_FILES &
+file_rename.sh $DIR $MAX_FILES &
+file_rename.sh $DIR $MAX_FILES &
+file_rename.sh $DIR $MAX_FILES &
 
-./file_link.sh $DIR $MAX_FILES &
-./file_link.sh $DIR $MAX_FILES &
-./file_link.sh $DIR $MAX_FILES &
+file_link.sh $DIR $MAX_FILES &
+file_link.sh $DIR $MAX_FILES &
+file_link.sh $DIR $MAX_FILES &
 
-./file_symlink.sh $DIR $MAX_FILES &
-./file_symlink.sh $DIR $MAX_FILES &
-./file_symlink.sh $DIR $MAX_FILES &
+file_symlink.sh $DIR $MAX_FILES &
+file_symlink.sh $DIR $MAX_FILES &
+file_symlink.sh $DIR $MAX_FILES &
 
-./file_concat.sh $DIR $MAX_FILES &
-./file_concat.sh $DIR $MAX_FILES &
-./file_concat.sh $DIR $MAX_FILES &
+file_concat.sh $DIR $MAX_FILES &
+file_concat.sh $DIR $MAX_FILES &
+file_concat.sh $DIR $MAX_FILES &
 
-./file_list.sh $DIR &
-./file_list.sh $DIR &
-./file_list.sh $DIR &
+file_list.sh $DIR &
+file_list.sh $DIR &
+file_list.sh $DIR &
 
-./file_rm.sh $DIR $MAX_FILES &
-./file_rm.sh $DIR $MAX_FILES &
-./file_rm.sh $DIR $MAX_FILES &
+file_rm.sh $DIR $MAX_FILES &
+file_rm.sh $DIR $MAX_FILES &
+file_rm.sh $DIR $MAX_FILES &
 
 echo "CTRL-C to exit"
 trap "
diff --git a/programs/dx_dirs_tests/index_dir_run.sh 
b/programs/dx_dirs_tests/index_dir_run.sh
index 381d144..bbd2fdc 100755
--- a/programs/dx_dirs_tests/index_dir_run.sh
+++ b/programs/dx_dirs_tests/index_dir_run.sh
@@ -43,7 +43,7 @@
 

 # Global Variables
 

-. ./o2tf.sh
+. `dirname ${0}`/o2tf.sh
 
 BLOCKSIZE=
 CLUSTERSIZE=
diff --git a/programs/dx_dirs_tests/multi_index_dir_run.sh 
b/programs/dx_dirs_tests/multi_index_dir_run.sh
index eb72a7d..c83b9f7 100755
--- a/programs/dx_dirs_tests/multi_index_dir_run.sh
+++ b/programs/dx_dirs_tests/multi_index_dir_run.sh
@@ -41,7 +41,7 @@
 

 # Global Variables
 

-. ./o2tf.sh
+. `dirname ${0}`/o2tf.sh
 
 BLOCKSIZE=
 CLUSTERSIZE=
diff --git a/programs/inline-data/multi-inline-run.sh 
b/programs/inline-data/multi-inline-run.sh
index 30e2e6a..1d51443 100755
--- a/programs/inline-data/multi-inline-run.sh
+++ b/programs/inline-data/multi-inline-run.sh
@@ -19,7 +19,7 @@
 PATH=$PATH:/sbin  # Add /sbin to the path for ocfs2 tools
 export PATH=$PATH:.
 
-. ./config.sh
+. `dirname ${0}`/config.sh
 
 #MPIRUN="`which mpirun`"
 
diff --git a/programs/inline-data/single-inline-run.sh 
b/programs/inline-data/single-inline-run.sh
index 938f461..5a176cd 100755
--- a/programs/inline-data/single-inline-run.sh
+++ b/programs/inline-data/single-inline-run.sh
@@ -19,7 +19,7 @@
 PATH=$PATH:/sbin  # Add /sbin to the path for ocfs2 tools
 export PATH=$PATH:.
 
-. ./config.sh
+. `dirname ${0}`/config.sh
 
 USERNAME=`id -un`

[Ocfs2-devel] [PATCH 04/17] Trivial: fix a typo mistake

2016-12-12 Thread Eric Ren
Signed-off-by: Eric Ren 
---
 programs/mkfs-tests/mkfs-test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh
index 3fc93a4..8fdd02a 100755
--- a/programs/mkfs-tests/mkfs-test.sh
+++ b/programs/mkfs-tests/mkfs-test.sh
@@ -431,7 +431,7 @@ fi;
 echo "Test ${testnum}: -L mylabel" |tee -a ${LOGFILE}
 label="my_label_is_very_very_very_long_to_the_point_of_being_useless"
 echo -n "mkfs . " |tee -a ${LOGFILE}
-${MKFS} -x -F -b 4K -C 4K -N 1 -L ${label} ${device} 262144 >{OUt} 2>&1
+${MKFS} -x -F -b 4K -C 4K -N 1 -L ${label} ${device} 262144 >${OUT} 2>&1
 echo "OK" |tee -a ${LOGFILE}
 echo -n "verify . " |tee -a ${LOGFILE}
 ${DEBUGFS} -R "stats" ${device} >${OUT} 2>&1
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 12/17] Add two cluster-aware parameters: cluster stack and cluster name

2016-12-12 Thread Eric Ren
With pacemaker as cluster stack, single node test always fail on
mkfs in some testcases. On suse OS, we use pcmk plugin as default
cluster stack. But in single node test, some testcases format ocfs2
volume as local filesystem. In such case, o2cb plugin is used. If
the next testcase want to format the volume with multiple slots, it
will fail because mkfs.ocfs2 cannot shift from o2cb to pcmk
automatically.

This patch should be merged into suse branch, without affecting
other OS release only using o2cb.

Signed-off-by: Eric Ren 
---
 programs/backup_super/test_backup_super.sh | 27 ++--
 .../discontig_bg_test/activate_discontig_bg.sh | 12 ++--
 programs/discontig_bg_test/discontig_runner.sh | 36 ++-
 programs/inline-data/multi-inline-run.sh   | 13 ++--
 programs/inline-data/single-inline-run.sh  | 10 ++-
 programs/mkfs-tests/mkfs-test.sh   | 46 -
 programs/python_common/multiple_run.sh | 22 ---
 programs/python_common/o2tf.sh | 16 -
 programs/python_common/single_run-WIP.sh   | 75 ++
 programs/reflink_tests/multi_reflink_test_run.sh   | 12 +++-
 programs/reflink_tests/reflink_test_run.sh |  8 ++-
 programs/tunefs-test/tunefs-test.sh| 11 ++--
 programs/xattr_tests/xattr-multi-run.sh| 15 -
 programs/xattr_tests/xattr-single-run.sh   | 13 ++--
 14 files changed, 215 insertions(+), 101 deletions(-)

diff --git a/programs/backup_super/test_backup_super.sh 
b/programs/backup_super/test_backup_super.sh
index 530109e..05da3e7 100755
--- a/programs/backup_super/test_backup_super.sh
+++ b/programs/backup_super/test_backup_super.sh
@@ -169,7 +169,8 @@ function test_mkfs()
msg1="debugfs should be sucess"
 
blkcount=`expr $vol_byte_size / $blocksize`
-   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
${DEVICE} $blkcount
+   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M \
+ --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} 
$blkcount
#first check whether mkfs is success
echo "ls //"|${DEBUGFS_BIN} ${DEVICE}|grep global_bitmap
exit_if_bad $? 0 $msg $LINENO
@@ -186,7 +187,8 @@ function test_mkfs()
 
${DD_BIN} if=/dev/zero of=$DEVICE bs=4096 count=3
clear_backup_blocks
-   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
${DEVICE} $blkcount
+   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M \
+   --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} 
${DEVICE} $blkcount
#first check whether mkfs is success
echo "ls //"|${DEBUGFS_BIN} ${DEVICE}|grep global_bitmap
exit_if_bad $? 0 $msg1 $LINENO
@@ -217,7 +219,8 @@ function test_fsck()
${DD_BIN} if=/dev/zero of=$DEVICE bs=4096 count=3
clear_backup_blocks
 
-   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
${DEVICE} $blkcount
+   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M \
+ --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} 
$blkcount
#corrupt the superblock
${DD_BIN} if=/dev/zero of=${DEVICE} bs=$blocksize count=3
${FSCK_BIN} -fy ${DEVICE}   #This should failed.
@@ -247,7 +250,8 @@ function test_tunefs_resize()
clear_backup_blocks
 
#mkfs a volume with no backup superblock
-   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
${DEVICE} $blkcount
+   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M \
+   --cluster-stack=${CLUSTER_STACK} 
--cluster-name=${CLUSTER_NAME} ${DEVICE} $blkcount
 
local bpc=`expr $clustersize / $blocksize`
local blkcount=`expr $blkcount + $bpc`
@@ -283,7 +287,8 @@ function test_tunefs_add_backup()
clear_backup_blocks
 
#mkfs a volume with no backup superblock supported
-   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
--no-backup-super ${DEVICE} $blkcount
+   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
--no-backup-super \
+ --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} 
$blkcount
 
#We can't open the volume by backup superblock now
echo "ls //"|${DEBUGFS_BIN} ${DEVICE} -s 1|grep global_bitmap
@@ -327,7 +332,8 @@ function test_tunefs_refresh()
 
local old_vol_name="old_ocfs2"
local new_vol_name="new_ocfs2"
-   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
-L $old_vol_name ${DEVICE} $blkcount
+   echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4  -J size=64M 
-L $old_vol_name \
+   --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} 
${DEVICE} $blkcount
check_vol $old_vol_name
 
#change the volume name
@@ -

[Ocfs2-devel] [PATCH 14/17] Fix openmpi warning by specifying proper slot number

2016-12-12 Thread Eric Ren
The warning message as below:

"
There are not enough slots available in the system to satisfy the 4
slots
that were requested by the application:
  ./xattr-multi-test

  Either request fewer slots for your application, or make more slots
  available
  for use.
"

outputs when specifying a rank number for openmpi more than "mkfs"
slots.

Signed-off-by: Eric Ren 
---
 programs/python_common/multiple_run.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/programs/python_common/multiple_run.sh 
b/programs/python_common/multiple_run.sh
index 3e52eff..74c3531 100755
--- a/programs/python_common/multiple_run.sh
+++ b/programs/python_common/multiple_run.sh
@@ -368,7 +368,7 @@ run_xattr_test()
local logdir=${LOG_DIR}/multi-xattr-test
 
LogRunMsg "xattr-test"
-   ${BINDIR}/xattr-multi-run.sh -r 4 -f ${NODE_LIST} -a ssh -o ${logdir} \
+   ${BINDIR}/xattr-multi-run.sh -r ${SLOTS} -f ${NODE_LIST} -a ssh -o 
${logdir} \
 -d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -s ${CLUSTER_STACK} -n 
${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1
LogRC $?
 }
@@ -378,7 +378,7 @@ run_inline_test()
local logdir=${LOG_DIR}/multi-inline-test
 
LogRunMsg "inline-test"
-   ${BINDIR}/multi-inline-run.sh -r 2 -f ${NODE_LIST} -a ssh -o ${logdir} \
+   ${BINDIR}/multi-inline-run.sh -r ${SLOTS} -f ${NODE_LIST} -a ssh -o 
${logdir} \
 -d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -s ${CLUSTER_STACK} -n 
${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1
LogRC $?
 }
@@ -389,7 +389,7 @@ run_reflink_test()
 
LogRunMsg "reflink-test"
LogMsg "reflink 'data=ordered' mode test"
-   ${BINDIR}/multi_reflink_test_run.sh -r 4 -f ${NODE_LIST} -a ssh -o \
+   ${BINDIR}/multi_reflink_test_run.sh -r ${SLOTS} -f ${NODE_LIST} -a ssh 
-o \
 ${logdir} -d ${DEVICE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} 
>> ${LOGFILE} 2>&1 || {
RET=$?
LogRC $RET
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 08/17] multiple node: pass cross_delete the right log file

2016-12-12 Thread Eric Ren
Pass cross_delete the right log file. However, openmpi should
log into config.LOGFILE,  because other remote nodes only have
this common log file.

Signed-off-by: Eric Ren 
---
 programs/cross_delete/cross_delete.py  | 4 ++--
 programs/python_common/multiple_run.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/programs/cross_delete/cross_delete.py 
b/programs/cross_delete/cross_delete.py
index ec3097c..1694d51 100755
--- a/programs/cross_delete/cross_delete.py
+++ b/programs/cross_delete/cross_delete.py
@@ -305,7 +305,7 @@ o2tf.OpenMPIInit(DEBUGON, ','.join(nodelist), logfile, 
'ssh')
cmdline = os.path.join(config.BINDIR, 'crdel_gen_files.py')
ret = o2tf.openmpi_run( DEBUGON, nproc, str('%s -s %s -l %s -t %s' % \
(cmdline, stagedir,
-   options.logfile,
+   config.LOGFILE,
tarfile) ),
','.join(nodelist),
'ssh',
@@ -324,7 +324,7 @@ o2tf.OpenMPIInit(DEBUGON, ','.join(nodelist), logfile, 
'ssh')
else:
cmdline = os.path.join(config.BINDIR, 'crdel_del_files.py')
ret = o2tf.openmpi_run( DEBUGON, nproc, str('%s -s %s -l %s ' % \
-   (cmdline, stagedir, options.logfile) ),
+   (cmdline, stagedir, config.LOGFILE) ),
','.join(nodelist),
'ssh',
options.interface,
diff --git a/programs/python_common/multiple_run.sh 
b/programs/python_common/multiple_run.sh
index 4340c40..9e2237a 100755
--- a/programs/python_common/multiple_run.sh
+++ b/programs/python_common/multiple_run.sh
@@ -318,7 +318,7 @@ run_cross_delete_test()
local workplace=${MOUNT_POINT}/cross_delete_test
 
run_common_testcase "cross_delete" "sparse,unwritten,inline-data" \
-"${BINDIR}/cross_delete.py -c 1 -i ${INTERFACE} -d ${workplace} -n 
${NODE_LIST} -t ${KERNELSRC}"
+"${BINDIR}/cross_delete.py -c 1 -l ${logfile} -i ${INTERFACE} -d ${workplace} 
-n ${NODE_LIST} -t ${KERNELSRC}"
 }
 
 run_write_append_truncate_test()
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 07/17] lvb_torture: failed when pcmk is used as cluster stack

2016-12-12 Thread Eric Ren
This test case failed with "pcmk" stack. Output errors
like:
"rank 1: /dlm/ has no write permission."
"rank 1: o2dlm_initialize failed: -1485330936".

Signed-off-by: Eric Ren 
---
 programs/lvb_torture/lvb_torture.c | 110 -
 programs/python_common/multiple_run.sh |  12 +++-
 2 files changed, 117 insertions(+), 5 deletions(-)

diff --git a/programs/lvb_torture/lvb_torture.c 
b/programs/lvb_torture/lvb_torture.c
index 1459849..93a29ec 100644
--- a/programs/lvb_torture/lvb_torture.c
+++ b/programs/lvb_torture/lvb_torture.c
@@ -180,6 +180,101 @@ static void run_test(struct o2dlm_ctxt *dlm, char *lockid)
}
 }
 
+/*
+ * Copied from run_test(), this is a ugly but straightforward workaround.
+ * "fsdlm" is used when using pcmk as cluster stack, which only supports
+ * 32-bits lvb so far.
+ */
+static void run_test_fsdlm(struct o2dlm_ctxt *dlm, char *lockid)
+{
+   unsigned long long iter = 0;
+   unsigned long long expected, to_write = 0;
+   int ret;
+   unsigned int read, written;
+   errcode_t err;
+   enum o2dlm_lock_level level;
+   __u32 lvb;
+
+   while (iter < max_iter && !caught_sig) {
+   expected = iter;
+
+   if ((iter % num_procs) == rank)
+   level = O2DLM_LEVEL_EXMODE;
+   else
+   level = O2DLM_LEVEL_PRMODE;
+
+   if (level == O2DLM_LEVEL_PRMODE) {
+   ret = MPI_Barrier(MPI_COMM_WORLD);
+   if (ret != MPI_SUCCESS)
+   rprintf(rank, "read MPI_Barrier failed: %d\n", 
ret);
+   err = o2dlm_lock(dlm, lockid, 0, level);
+   if (err)
+   rprintf(rank, "o2dlm_lock failed: %d\n", err);
+
+   expected++;
+   } else {
+   err = o2dlm_lock(dlm, lockid, 0, level);
+   if (err)
+   rprintf(rank, "o2dlm_lock failed: %d\n", err);
+
+   ret = MPI_Barrier(MPI_COMM_WORLD);
+   if (ret != MPI_SUCCESS)
+   rprintf(rank, "read MPI_Barrier failed: %d\n", 
ret);
+   to_write = iter + 1;
+   }
+
+   err = o2dlm_read_lvb(dlm, lockid, (char *)&lvb, sizeof(lvb),
+&read);
+   if (err)
+   rprintf(rank, "o2dlm_read_lvb failed: %d\n", err);
+
+   lvb = be32_to_cpu(lvb);
+
+   if (level == O2DLM_LEVEL_PRMODE)
+   printf("%s: read  iter: %llu, lvb: %llu exp: %llu\n",
+  hostname, (unsigned long long)iter,
+  (unsigned long long)lvb,
+  (unsigned long long)expected);
+   else
+   printf("%s: write iter: %llu, lvb: %llu wri: %llu\n",
+  hostname, (unsigned long long)iter,
+  (unsigned long long)lvb,
+  (unsigned long long)to_write);
+
+   fflush(stdout);
+
+   if (lvb != expected) {
+   printf("Test failed! %s: rank %d, read lvb %llu, 
expected %llu\n",
+  hostname, rank, (unsigned long long) lvb,
+  (unsigned long long) expected);
+   MPI_Abort(MPI_COMM_WORLD, 1);
+   }
+
+   if (level == O2DLM_LEVEL_EXMODE) {
+   lvb = cpu_to_be32(to_write);
+
+   err = o2dlm_write_lvb(dlm, lockid, (char *)&lvb,
+ sizeof(lvb), &written);
+   if (err)
+   rprintf(rank, "o2dlm_write_lvb failed: %d\n", 
err);
+   if (written != sizeof(lvb))
+   rprintf(rank, "o2dlm_write_lvb() wrote %d, we 
asked for %d\n", written, sizeof(lvb));
+   }
+
+   err = o2dlm_unlock(dlm, lockid);
+   if (err)
+   rprintf(rank, "o2dlm_unlock failed: %d\n", err);
+
+   /* This second barrier is not necessary and can be
+* commented out to ramp the test up */
+   ret = MPI_Barrier(MPI_COMM_WORLD);
+   if (ret != MPI_SUCCESS)
+   rprintf(rank, "unlock MPI_Barrier failed: %d\n", ret);
+
+   iter++;
+   }
+}
+
 static void clear_lock(struct o2dlm_ctxt *dlm, char *lockid)
 {
char empty[O2DLM_LOCK_ID_MAX_LEN];
@@ -363,8 +458,7 @@ int main(int argc, char *argv[])
 
 printf("%s: rank: %d, nodes: %d, dlm: %s, dom: %s, lock: %s, iter: 
%llu\n", hostname, rank, num_procs, dlmfs_path, domain, lockid, (unsigned long 
long) max_iter);
 
-   
-   if (access(dlmfs_path, W_OK) < 0) {
+   if (strc

[Ocfs2-devel] [PATCH 17/17] discontig bg: give single and multiple node test different log file name

2016-12-12 Thread Eric Ren
Signed-off-by: Eric Ren 
---
 programs/discontig_bg_test/discontig_runner.sh | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/programs/discontig_bg_test/discontig_runner.sh 
b/programs/discontig_bg_test/discontig_runner.sh
index 182ca3a..f3a69f5 100755
--- a/programs/discontig_bg_test/discontig_runner.sh
+++ b/programs/discontig_bg_test/discontig_runner.sh
@@ -164,8 +164,13 @@ function f_setup()
LOG_DIR=${LOG_DIR:-$DEFAULT_LOG_DIR}
${MKDIR_BIN} -p ${LOG_DIR} || exit 1

-   RUN_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\
-%M-%S`-discontig-bg-run.log"
+   if [ -n "${MULTI_TEST}" ];then
+   RUN_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date 
+%F-%H-\
+%M-%S`-discontig-bg-multiple-run.log"
+   else
+   RUN_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date 
+%F-%H-\
+%M-%S`-discontig-bg-single-run.log"
+   fi
LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\
 %M-%S`-discontig-bg.log"
 PUNCH_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date 
+%F-%H-\
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 09/17] Single run: make blocksize and clustersize as parameters

2016-12-12 Thread Eric Ren
It takes too long to get the result of a round testing. This
can shorten a lot time by eliminating 2-layer loops with blocksize
and clustersize. Now blocksize defaults to 4096, while clustersize
to 32768 if not specified.

Signed-off-by: Eric Ren 
---
 programs/backup_super/test_backup_super.sh |  29 +++-
 programs/inline-data/single-inline-run.sh  |  24 ++-
 programs/mkfs-tests/mkfs-test.sh   |  27 +++-
 programs/python_common/single_run-WIP.sh   | 247 +
 programs/reflink_tests/reflink_test_run.sh |  26 ++-
 programs/tunefs-test/tunefs-test.sh|  28 +++-
 programs/xattr_tests/xattr-single-run.sh   |  26 ++-
 7 files changed, 308 insertions(+), 99 deletions(-)

diff --git a/programs/backup_super/test_backup_super.sh 
b/programs/backup_super/test_backup_super.sh
index ed7c94b..530109e 100755
--- a/programs/backup_super/test_backup_super.sh
+++ b/programs/backup_super/test_backup_super.sh
@@ -49,6 +49,9 @@ LOGFILE=""
 FIRST_BACKUP_OFF=1073741824#1G
 MAX_NUM=6
 
+blocksize=
+clustersize=
+
 #
 # usageDisplay help information and exit.
 #
@@ -65,11 +68,13 @@ function usage()
  --with-mkfs=PROGRAM  use the PROGRAM as fswreck
  --with-debugfs=PROGRAMuse the PROGRAM as mkfs.ocfs2
  --with-tunefs=PROGRAMuse the PROGRAM as tunefs.ocfs2
+ --block-size=blocksize   block size
+ --cluster-size=clustersize   cluster size
 
Examples:
 
- $script --with-debugfs=../debugfs.ocfs2/debugfs.ocfs2 /dev/sde2
- $script --with-mkfs=/sbin/mkfs.ocfs2 --log-dir=/tmp /dev/sde2
+ $script --with-debugfs=../debugfs.ocfs2/debugfs.ocfs2 
--block-size=4096 --clustersize=32768??/dev/sde2
+ $script --with-mkfs=/sbin/mkfs.ocfs2 --log-dir=/tmp --block-size=4096 
--clustersize=32768 /dev/sde2
EOF
 }
 
@@ -376,10 +381,20 @@ function volume_small_test()
 ##
 function normal_test()
 {
-   for blocksize in 512 4096
+   if [ "$blocksize" != "NONE" ];then
+   bslist="$blocksize"
+   else
+   bslist="512 4096"
+   fi
+   if [ "$clustersize" != "NONE" ];then
+   cslist="$clustersize"
+   else
+   cslist="4096 32768 1048576"
+   fi
+   for blocksize in $(echo "$bslist")
do
for clustersize in \
-   4096 32768 1048576
+   $(echo "$cslist")
do
 
vol_byte_size=$FIRST_BACKUP_OFF
@@ -462,6 +477,12 @@ do
"--with-tunefs="*)
TUNEFS_BIN="${1#--with-tunefs=}"
;;
+   "--block-size="*)
+   blocksize="${1#--block-size=}"
+   ;;
+   "--cluster-size="*)
+   clustersize="${1#--cluster-size=}"
+   ;;
*)
DEVICE="$1"
;;
diff --git a/programs/inline-data/single-inline-run.sh 
b/programs/inline-data/single-inline-run.sh
index 5a176cd..89b2f4c 100755
--- a/programs/inline-data/single-inline-run.sh
+++ b/programs/inline-data/single-inline-run.sh
@@ -105,8 +105,10 @@ exit_or_not()
 

 f_usage()
 {
-echo "usage: `basename ${0}` [-o output] <-d > "
+echo "usage: `basename ${0}` [-o output] <-b blocksize> <-c clustersize> 
<-d > "
 echo "   -o output directory for the logs"
+echo "   -b blocksize"
+echo "   -c clustersize"
 echo "   -d device name used for ocfs2 volume"
 echo "path of mountpoint where the ocfs2 volume 
will be mounted on."
 exit 1;
@@ -120,10 +122,12 @@ f_getoptions()
 exit 1
  fi
 
- while getopts "o:hd:" options; do
+ while getopts "o:hd:b:c:" options; do
 case $options in
 o ) LOG_OUT_DIR="$OPTARG";;
 d ) OCFS2_DEVICE="$OPTARG";;
+b ) BLOCKSIZE="$OPTARG";;
+c ) CLUSTERSIZE="$OPTARG";;
 h ) f_usage
 exit 1;;
 * ) f_usage
@@ -132,7 +136,6 @@ f_getoptions()
 done
 shift $(($OPTIND -1))
 MOUNT_POINT=${1}
-
 }
 
 f_setup()
@@ -373,9 +376,20 @@ trap ' : ' SIGTERM
 
 f_setup $*
 
-for BLOCKSIZE in 512 1024 4096
+if [ "$BLOCKSIZE" != "NONE" ];then
+   bslist="$BLOCKSIZE"
+else
+   bslist="512 1024 4096"
+fi
+if [ "$CLUSTERSIZE" != "NONE" ];then
+   cslist="$CLUSTERSIZE"
+else
+   cslist="4096 32768 1048576"
+fi
+
+for BLOCKSIZE in $(echo "$bslist")
 do
-   for CLUSTERSIZE in 4096 32768 1048576
+   for CLUSTERSIZE in $(echo "$cslist")
do
echo "++Single node inline-data test with \"-b 
${BLOCKSIZE} -C ${CLUSTERSIZE}\"++" |tee -a ${RUN_LOG_FILE}
echo "++Single node inline-data test with \"-b 
${BLOCKSIZE} -C ${CL

[Ocfs2-devel] [PATCH 13/17] Save punch_hole details into logfile for debugging convenience

2016-12-12 Thread Eric Ren
Signed-off-by: Eric Ren 
---
 programs/discontig_bg_test/discontig_runner.sh | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/programs/discontig_bg_test/discontig_runner.sh 
b/programs/discontig_bg_test/discontig_runner.sh
index 3be39c8..4c13adb 100755
--- a/programs/discontig_bg_test/discontig_runner.sh
+++ b/programs/discontig_bg_test/discontig_runner.sh
@@ -41,6 +41,7 @@ DEFAULT_LOG_DIR=${O2TDIR}/log
 LOG_DIR=
 RUN_LOG_FILE=
 LOG_FILE=
+PUNCH_LOG_FILE=
 
 BLOCKSIZE=
 CLUSTERSIZE=
@@ -162,6 +163,8 @@ function f_setup()
 %M-%S`-discontig-bg-run.log"
LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\
 %M-%S`-discontig-bg.log"
+PUNCH_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date 
+%F-%H-\
+%M-%S`-punch-hole.log"
 
 }
 
@@ -529,7 +532,7 @@ function f_extents_test()
recs_in_blk=$(((${BLOCKSIZE}-64)/16))
while :;do
if [ "$((${RANDOM}%2))" -eq "0" ];then
-   ${PUNCH_HOLE_BIN} -f ${filename} -s ${offset} -l 
$((${CLUSTERSIZE}*${recs_in_blk})) >>/dev/null 2>&1 || {
+   ${PUNCH_HOLE_BIN} -f ${filename} -s ${offset} -l 
$((${CLUSTERSIZE}*${recs_in_blk})) >>${PUNCH_LOG_FILE} 2>&1 || {
f_LogMsg ${LOG_FILE} "Punch hole at 
offset:${offset} failed."
return 1
}
@@ -798,13 +801,13 @@ function f_refcount_test()
fi
while :;do
if [ "$((${RANDOM}%2))" -eq "0" ];then
-   ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l 
${CLUSTERSIZE} >>/dev/null 2>&1 || {
+   ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l 
${CLUSTERSIZE} >>${PUNCH_LOG_FILE} 2>&1 || {
f_LogMsg ${LOG_FILE} "Punch hole at 
offset:${offset} failed on ${orig_filename}."
return 1
}
fi
if [ "$((${RANDOM}%2))" -eq "1" ];then
-   ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l 
${CLUSTERSIZE} >>/dev/null 2>&1 || {
+   ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l 
${CLUSTERSIZE} >>${PUNCH_LOG_FILE} 2>&1 || {
f_LogMsg ${LOG_FILE} "Punch hole at 
offset:${offset} failed on ${ref_filename}."
return 1
}
@@ -822,14 +825,14 @@ function f_refcount_test()
recs_in_blk=$(((${BLOCKSIZE}-64)/16))
while :;do
if [ "$((${RANDOM}%2))" -eq "0" ];then
-   ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l 
$((${CLUSTERSIZE}*${recs_in_blk})) >>/dev/null 2>&1 || {
+   ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l 
$((${CLUSTERSIZE}*${recs_in_blk})) >>${PUNCH_LOG_FILE} 2>&1 || {
f_LogMsg ${LOG_FILE} "Punch hole at 
offset:${offset} failed on ${orig_filename}."
return 1
}
fi
 
if [ "$((${RANDOM}%2))" -eq "1" ];then
-   ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l 
$((${CLUSTERSIZE}*${recs_in_blk})) >>/dev/null 2>&1 || {
+   ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l 
$((${CLUSTERSIZE}*${recs_in_blk})) >>${PUNCH_LOG_FILE} 2>&1 || {
f_LogMsg ${LOG_FILE} "Punch hole at 
offset:${offset} failed on ${ref_filename}."
return 1
}
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 05/17] Trivial: fix checking empty return value

2016-12-12 Thread Eric Ren
We now get the below error even if "reserve space"
testcase succeeds:
"Error in log_end()"
This is because we passed Nil to log_end.

Signed-off-by: Eric Ren 
---
 programs/python_common/single_run-WIP.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/programs/python_common/single_run-WIP.sh 
b/programs/python_common/single_run-WIP.sh
index 99f24cc..d474463 100755
--- a/programs/python_common/single_run-WIP.sh
+++ b/programs/python_common/single_run-WIP.sh
@@ -781,6 +781,7 @@ run_reserve_space()
done
 
do_umount ${mountpoint}
+   RC=$?
 
log_end ${RC}
done
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 02/17] Single Run: kernel building is little broken now

2016-12-12 Thread Eric Ren
Only check kernel source if we specify "buildkernel" test case.
The original kernel source web-link cannot be reached,
so give a new link instead but the md5sum check is missing
now.

Signed-off-by: Eric Ren 
---
 programs/python_common/single_run-WIP.sh | 56 
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/programs/python_common/single_run-WIP.sh 
b/programs/python_common/single_run-WIP.sh
index fe0056c..61008d8 100755
--- a/programs/python_common/single_run-WIP.sh
+++ b/programs/python_common/single_run-WIP.sh
@@ -20,9 +20,9 @@ WGET=`which wget`
 WHOAMI=`which whoami`
 SED=`which sed`
 
-DWNLD_PATH="http://oss.oracle.com/~smushran/ocfs2-test";
-KERNEL_TARBALL="linux-kernel.tar.gz"
-KERNEL_TARBALL_CHECK="${KERNEL_TARBALL}.md5sum"
+DWNLD_PATH="https://cdn.kernel.org/pub/linux/kernel/v3.x/";
+KERNEL_TARBALL="linux-3.2.80.tar.xz"
+#KERNEL_TARBALL_CHECK="${KERNEL_TARBALL}.md5sum"
 USERID=`${WHOAMI}`
 
 DEBUGFS_BIN="${SUDO} `which debugfs.ocfs2`"
@@ -85,7 +85,7 @@ get_bits()
 # get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL $KERNEL_TARBALL_CHECK
 get_kernel_source()
 {
-   if [ "$#" -lt "4" ]; then
+   if [ "$#" -lt "3" ]; then
${ECHO} "Error in get_kernel_source()"
exit 1
fi
@@ -93,18 +93,18 @@ get_kernel_source()
logdir=$1
dwnld_path=$2
kernel_tarball=$3
-   kernel_tarball_check=$4
+   #kernel_tarball_check=$4
 
cd ${logdir}
 
outlog=get_kernel_source.log
 
-   ${WGET} -o ${outlog} ${dwnld_path}/${kernel_tarball_check}
-   if [ $? -ne 0 ]; then
-   ${ECHO} "ERROR downloading 
${dwnld_path}/${kernel_tarball_check}"
-   cd -
-   exit 1
-   fi
+#  ${WGET} -o ${outlog} ${dwnld_path}/${kernel_tarball_check}
+#  if [ $? -ne 0 ]; then
+#  ${ECHO} "ERROR downloading 
${dwnld_path}/${kernel_tarball_check}"
+#  cd -
+#  exit 1
+#  fi
 
${WGET} -a ${outlog} ${dwnld_path}/${kernel_tarball}
if [ $? -ne 0 ]; then
@@ -113,13 +113,13 @@ get_kernel_source()
exit 1
fi
 
-   ${MD5SUM} -c ${kernel_tarball_check} >>${outlog} 2>&1
-   if [ $? -ne 0 ]; then
-   ${ECHO} "ERROR ${kernel_tarball_check} check failed"
-   cd -
-   exit 1
-   fi
-   cd -
+#  ${MD5SUM} -c ${kernel_tarball_check} >>${outlog} 2>&1
+#  if [ $? -ne 0 ]; then
+#  ${ECHO} "ERROR ${kernel_tarball_check} check failed"
+#  cd -
+#  exit 1
+#  fi
+#  cd -
 }
 
 # do_format() ${BLOCKSIZE} ${CLUSTERSIZE} ${FEATURES} ${DEVICE}
@@ -1012,16 +1012,6 @@ LOGFILE=${LOGDIR}/single_run.log
 
 do_mkdir ${LOGDIR}
 
-if [ -z ${KERNELSRC} ]; then
-   get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL 
$KERNEL_TARBALL_CHECK
-   KERNELSRC=${LOGDIR}/${KERNEL_TARBALL}
-fi
-
-if [ ! -f ${KERNELSRC} ]; then
-   ${ECHO} "No kernel source"
-   usage
-fi
-
 STARTRUN=$(date +%s)
 log_message "*** Start Single Node test ***"
 
@@ -1058,6 +1048,16 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do
fi
 
if [ "$tc"X = "buildkernel"X -o "$tc"X = "all"X ];then
+   if [ -z ${KERNELSRC} ]; then
+   get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL 
#$KERNEL_TARBALL_CHECK
+   KERNELSRC=${LOGDIR}/${KERNEL_TARBALL}
+   fi
+
+   if [ ! -f ${KERNELSRC} ]; then
+   ${ECHO} "No kernel source"
+   usage
+   fi
+
run_buildkernel ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${KERNELSRC}
fi
 
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 06/17] multi_mmap: make log messages go to right place

2016-12-12 Thread Eric Ren
The option "--logfile" is missing now. Thus, log
messages go into "o2t.log", which is a apparent
mistake.

Signed-off-by: Eric Ren 
---
 programs/python_common/multiple_run.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/python_common/multiple_run.sh 
b/programs/python_common/multiple_run.sh
index c4a7da9..2e0ec72 100755
--- a/programs/python_common/multiple_run.sh
+++ b/programs/python_common/multiple_run.sh
@@ -339,7 +339,7 @@ run_multi_mmap_test()
local testfile=${workplace}/multi_mmap_test_file
 
run_common_testcase "multi_mmap" "sparse,unwritten,inline-data" \
-"${BINDIR}/run_multi_mmap.py -i 2 -I ${INTERFACE} -n ${NODE_LIST} -c -b 
6000 --hole -f ${testfile}"
+"${BINDIR}/run_multi_mmap.py -i 2 -I ${INTERFACE} -l ${logfile} -n 
${NODE_LIST} -c -b 6000 --hole -f ${testfile}"
 }
 
 run_create_racer_test()
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 01/17] ocfs2 test: correct the check on testcase if supported

2016-12-12 Thread Eric Ren
Signed-off-by: Eric Ren 
---
 programs/python_common/multiple_run.sh   | 2 +-
 programs/python_common/single_run-WIP.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/python_common/multiple_run.sh 
b/programs/python_common/multiple_run.sh
index dd9603f..c4a7da9 100755
--- a/programs/python_common/multiple_run.sh
+++ b/programs/python_common/multiple_run.sh
@@ -201,7 +201,7 @@ f_setup()
fi
 
SUPPORTED_TESTCASES="all xattr inline reflink write_append_truncate 
multi_mmap create_racer flock_unit cross_delete open_delete lvb_torture"
-   for cas in ${TESTCASES}; do
+   for cas in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do
echo ${SUPPORTED_TESTCASES} | grep -sqw $cas
if [ $? -ne 0 ]; then
echo "testcase [${cas}] not supported."
diff --git a/programs/python_common/single_run-WIP.sh 
b/programs/python_common/single_run-WIP.sh
index 5a8fae1..fe0056c 100755
--- a/programs/python_common/single_run-WIP.sh
+++ b/programs/python_common/single_run-WIP.sh
@@ -997,7 +997,7 @@ fi
 SUPPORTED_TESTCASES="all create_and_open directaio fillverifyholes 
renamewriterace aiostress\
   filesizelimits mmaptruncate buildkernel splice sendfile mmap reserve_space 
inline xattr\
   reflink mkfs tunefs backup_super filecheck"
-for cas in ${TESTCASES}; do
+for cas in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do
echo ${SUPPORTED_TESTCASES} | grep -sqw $cas
if [ $? -ne 0 ]; then
echo "testcase [${cas}] not supported."
-- 
2.6.6


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


[Ocfs2-devel] [PATCH 00/17] ocfs2-test: misc improvements and trivial fixes

2016-12-12 Thread Eric Ren
- Misc trivial fixes:

[PATCH 01/17] ocfs2 test: correct the check on testcase if supported
[PATCH 02/17] Single Run: kernel building is little broken now
[PATCH 03/17] Trivial: better not to depend on where we issue testing
[PATCH 04/17] Trivial: fix a typo mistake
[PATCH 05/17] Trivial: fix checking empty return value
[PATCH 06/17] multi_mmap: make log messages go to right place
[PATCH 07/17] lvb_torture: failed when pcmk is used as cluster stack
[PATCH 08/17] multiple node: pass cross_delete the right log file

- This patches add two more parameters: blocksize and clustersize when we
kick off a testing, which shortens the run time of a testing round.
It will keep the old behaviors if they are not specified.

[PATCH 09/17] Single run: make blocksize and clustersize as
[PATCH 10/17] Multiple run: make blocksize and clustersize as
[PATCH 11/17] discontig bg: make blocksize and clustersize as

- This patch reflects the mkfs.ocfs2 changes that "--cluster-stack" and
"--cluster-name" were added.

[PATCH 12/17] Add two cluster-aware parameters: cluster stack and cluster name

- More misc trival fixes:

[PATCH 13/17] Save punch_hole details into logfile for debugging
[PATCH 14/17] Fix openmpi warning by specifying proper slot number
[PATCH 15/17] Handle the case when a symbolic link device is given
[PATCH 16/17] inline data: fix build error
[PATCH 17/17] discontig bg: give single and multiple node test

Comments and questions are, as always, welcome.

Thanks,
Eric


___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


Re: [Ocfs2-devel] [PATCH 2/7] ocfs2/reflink: fix file block size reporting

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 05:48:20PM +0800, Eryu Guan wrote:
> On Sun, Dec 11, 2016 at 01:52:57PM -0800, Darrick J. Wong wrote:
> > Some of the reflink tests try to require a specific filesystem block
> > size so that they can test file block manipulation functions.  That's
> > straightforward for most filesystems but ocfs2 throws in the additional
> > twist that data fork block mappings are stored in units of clusters, not
> > blocks, which causes these reflink tests to fail.
> > 
> > Therefore, introduce a new helper that retrieves the file minimum block
> > size and adapt the reflink tests to use that instead.
> > 
> > Signed-off-by: Darrick J. Wong 
> > ---
> >  common/rc |   21 +++--
> >  tests/generic/205 |2 +-
> >  tests/generic/206 |2 +-
> >  tests/generic/216 |2 +-
> >  tests/generic/217 |2 +-
> >  tests/generic/218 |2 +-
> >  tests/generic/220 |2 +-
> >  tests/generic/222 |2 +-
> >  tests/generic/227 |2 +-
> >  tests/generic/229 |2 +-
> >  tests/generic/238 |2 +-
> >  11 files changed, 29 insertions(+), 12 deletions(-)
> > 
> > 
> > diff --git a/common/rc b/common/rc
> > index 2639fbd..30111d4 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -925,7 +925,7 @@ _scratch_mkfs_blocksized()
> > ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV
> > ;;
> >  ocfs2)
> > -   yes | ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV
> > +   yes | ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize -C $blocksize 
> > $SCRATCH_DEV
> > ;;
> >  *)
> > _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized"
> > @@ -3029,13 +3029,30 @@ _sysfs_dev()
> > echo /sys/dev/block/$_maj:$_min
> >  }
> >  
> > +# Get the minimum block size of a file.  Usually this is the
> > +# minimum fs block size, but some filesystems (ocfs2) do block
> > +# mappings in larger units.
> > +get_file_block_size()
> 
> Name it with leading underscore? As it's a common helper.
> 
> > +{
> > +   if [ -z $1 ] || [ ! -d $1 ]; then
> > +   echo "Missing mount point argument for get_file_block_size"
> > +   exit 1
> > +   fi
> > +   if [ "$FSTYP" = "ocfs2" ]; then
> > +   stat -c '%o' $1
> > +   else
> > +   stat -f -c '%S' $1
> 
> We can use "get_block_size $1" here.
> 
> > +   fi
> > +}
> > +
> > +# Get the minimum block size of an fs.
> >  get_block_size()
> 
> We should rename it with a underscore too, but probably in an different
> patch.

Ok.

--D

> 
> Thanks,
> Eryu
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


Re: [Ocfs2-devel] [PATCH 3/7] reflink: fix quota tests to work properly

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 06:06:22PM +0800, Eryu Guan wrote:
> On Sun, Dec 11, 2016 at 01:53:04PM -0800, Darrick J. Wong wrote:
> > Fix the reflink quota tests to su to the fsgqa user so that we actually
> > test enforcement of quotas.  Seems that XFS enforces user quotas even
> > if root is writing to a user file, whereas everything else lets root
> > writes through.  Also clean up some of the variable usage and
> > _require_user.
> > 
> > Signed-off-by: Darrick J. Wong 
> > ---
> >  tests/generic/305 |2 +-
> >  tests/generic/305.out |   30 +++---
> >  tests/generic/326 |2 +-
> >  tests/generic/326.out |   30 +++---
> >  tests/generic/327 |   12 +++-
> >  tests/generic/327.out |   12 ++--
> >  tests/generic/328 |   14 --
> >  tests/generic/328.out |   28 ++--
> >  8 files changed, 67 insertions(+), 63 deletions(-)
> > 
> > 
> > diff --git a/tests/generic/305 b/tests/generic/305
> > index d73d87f..9c3489b 100755
> > --- a/tests/generic/305
> > +++ b/tests/generic/305
> > @@ -51,7 +51,7 @@ _require_quota
> >  _require_nobody
> >  
> >  _repquota() {
> > -   repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)'
> > +   repquota -O csv $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' | awk -F 
> > ',' '{print $1, $4, $5, $6}'
> 
> The version of "quota" is a bit old shipped by RHEL7, there's no "-O"
> option support. And this works for me
> 
>   repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' | awk '{print $1, 
> $3, $4, $5}'
> 
> Still worth chaning the .out files this way?

Yes, because the inode usage counts aren't guaranteed to be the same
between filesystems due to weirdness in the root inode counts.

Basically, ocfs2 charges an additional 2 root inode count right off the
bat, which screws up the golden output.  btrfs doesn't have user/group
quotas, so the reflink-quota tests only ever checked XFS in the past.

I'll fix it not to rely on -O csv.

--D

> 
> Thanks,
> Eryu
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


Re: [Ocfs2-devel] [PATCH 5/7] reflink: make error reporting consistent

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 06:47:43PM +0800, Eryu Guan wrote:
> On Sun, Dec 11, 2016 at 01:53:16PM -0800, Darrick J. Wong wrote:
> > When we're using dm-error to simulate failed devices, we don't really
> > know if the write or the fdatasync is going to receive the EIO.  So,
> > capture the entire output and just look for the word error instead
> > of enshrining it in the golden output.
> > 
> > Signed-off-by: Darrick J. Wong 
> > ---
> >  tests/generic/265 |6 +-
> >  tests/generic/265.out |1 -
> >  tests/generic/266 |5 -
> >  tests/generic/266.out |1 -
> >  tests/generic/267 |2 +-
> >  tests/generic/268 |5 -
> >  tests/generic/268.out |1 -
> >  tests/generic/271 |5 +++--
> >  tests/generic/271.out |1 -
> >  tests/generic/272 |5 +++--
> >  tests/generic/272.out |1 -
> >  tests/generic/276 |2 +-
> >  tests/generic/276.out |1 -
> >  tests/generic/278 |5 +++--
> >  tests/generic/278.out |1 -
> >  tests/generic/279 |4 ++--
> >  tests/generic/279.out |1 -
> >  tests/generic/281 |4 ++--
> >  tests/generic/281.out |1 -
> >  tests/generic/283 |6 --
> >  tests/generic/283.out |1 -
> >  21 files changed, 32 insertions(+), 27 deletions(-)
> > 
> > 
> > diff --git a/tests/generic/265 b/tests/generic/265
> > index 8e9d5bc..ceddfbe 100755
> > --- a/tests/generic/265
> > +++ b/tests/generic/265
> > @@ -80,7 +80,11 @@ md5sum $testdir/file2 | _filter_scratch
> >  echo "CoW and unmount"
> >  sync
> >  _dmerror_load_error_table
> > -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" 
> > $testdir/file2 >> $seqres.full
> > +urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \
> > +   -c "fdatasync" $testdir/file2 2>&1)
> > +echo $urk >> $seqres.full
> > +echo "$urk" | grep -q "error" || _fail "pwrite did not fail"
> > +
> >  _dmerror_load_working_table
> >  _dmerror_unmount
> >  _dmerror_mount
> > diff --git a/tests/generic/265.out b/tests/generic/265.out
> > index 1b67114..31eb4e9 100644
> > --- a/tests/generic/265.out
> > +++ b/tests/generic/265.out
> > @@ -5,7 +5,6 @@ Compare files
> >  1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-265/file1
> >  1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-265/file2
> >  CoW and unmount
> > -fdatasync: Input/output error
> >  Compare files
> >  1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-265/file1
> >  Check for damage
> > diff --git a/tests/generic/266 b/tests/generic/266
> > index 4f9816a..09541c8 100755
> > --- a/tests/generic/266
> > +++ b/tests/generic/266
> > @@ -80,7 +80,10 @@ md5sum $testdir/file2 | _filter_scratch
> >  echo "CoW and unmount"
> >  sync
> >  _dmerror_load_error_table
> > -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" 
> > $testdir/file2 >> $seqres.full
> > +urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \
> > +   -c "fdatasync" $testdir/file2 2>&1)
> > +echo $urk >> $seqres.full
> > +echo "$urk" | grep -q "error" || _fail "pwrite did not fail"
> >  
> >  echo "Clean up the mess"
> >  _dmerror_unmount
> > diff --git a/tests/generic/266.out b/tests/generic/266.out
> > index dd34ad3..1641654 100644
> > --- a/tests/generic/266.out
> > +++ b/tests/generic/266.out
> > @@ -5,7 +5,6 @@ Compare files
> >  1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-266/file1
> >  1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-266/file2
> >  CoW and unmount
> > -fdatasync: Input/output error
> >  Clean up the mess
> >  Compare files
> >  1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-266/file1
> > diff --git a/tests/generic/267 b/tests/generic/267
> > index e3a6b0c..2ec6ad9 100755
> > --- a/tests/generic/267
> > +++ b/tests/generic/267
> > @@ -80,7 +80,7 @@ md5sum $testdir/file2 | _filter_scratch
> >  echo "CoW and unmount"
> >  sync
> >  _dmerror_load_error_table
> > -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 
> > >> $seqres.full
> > +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 
> > >> $seqres.full 2>&1
> >  _dmerror_load_working_table
> >  rm -rf $testdir/file2 >> $seqres.full 2>&1
> >  _dmerror_unmount
> > diff --git a/tests/generic/268 b/tests/generic/268
> > index c7dcd57..b7d16ab 100755
> > --- a/tests/generic/268
> > +++ b/tests/generic/268
> > @@ -81,7 +81,10 @@ md5sum $testdir/file2 | _filter_scratch
> >  echo "CoW and unmount"
> >  sync
> >  _dmerror_load_error_table
> > -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" 
> > $testdir/file2 >> $seqres.full
> > +urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \
> > +   -c "fdatasync" $testdir/file2 2>&1)
> > +echo $urk >> $seqres.full
> > +echo "$urk" | grep -q "error" || _fail "pwrite did not fail"
> >  _dmerror_load_working_table
> >  
> >  echo "Rewrite"
> > diff --git a/tests/generic/268.out b/tests/generic/268.out
> > index 234e8be..1a3b39a 100644
> > --- a/tests/gen

Re: [Ocfs2-devel] [PATCH 4/7] reflink: fix space consumption tests

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 06:25:39PM +0800, Eryu Guan wrote:
> On Sun, Dec 11, 2016 at 01:53:10PM -0800, Darrick J. Wong wrote:
> > Some of the tests try to check that we can't COW when we're out of
> > space, but some tricky filesystems make this hard because writing N
> > blocks doesn't increase used blocks by N
> > 
> > Signed-off-by: Darrick J. Wong 
> > ---
> >  common/populate   |   14 ++
> >  tests/generic/171 |5 ++---
> >  tests/generic/173 |5 ++---
> >  tests/generic/174 |5 ++---
> >  tests/generic/282 |3 +--
> >  5 files changed, 21 insertions(+), 11 deletions(-)
> > 
> > 
> > diff --git a/common/populate b/common/populate
> > index d0003c5..9811d21 100644
> > --- a/common/populate
> > +++ b/common/populate
> > @@ -30,6 +30,20 @@ _require_xfs_db_blocktrash_z_command() {
> > $XFS_DB_PROG -x -f -c 'blocktrash -z' "${TEST_DEV}" | grep -q 'nothing 
> > on stack' || _notrun "blocktrash -z not supported"
> >  }
> >  
> > +# Eat free space until we can't anymore.
> > +_consume_free_space() {
> > +   dir=$1
> > +
> > +   old_nr_free=0
> > +   nr_free=$(stat -f -c '%f' $dir)
> > +   x=0
> > +   while [ $nr_free -gt 0 ] && [ $old_nr_free != $nr_free ]; do
> > +   $XFS_IO_PROG -f -c "pwrite -b 4194304 0 $((blksz * nr_free))" 
> > $dir/eat_my_space.$((x++))
> 
> blksz not defined in the function.
> 
> Xiaoguang Wang did something similar back in Nov. and I'm still queuing
> his patch. (His 1/2 patch conflicts with your scrub/repair patchset and
> it might be easier for you to let your patches go first.)
> 
> generic: make 17[1-4] work well when btrfs compression is enabled
> https://patchwork.kernel.org/patch/9408451/
> 
> Does this patch work for you? If so, perhaps you only need to update
> generic/282 using the "_fill_fs" helper?

Aha!  I had this feeling in the back of my head that someone was
already trying to push a helper function.

At this point XFS online scrub/repair is slipping to 4.11 anyway so you
may as well take Xioguang's patches and I'll just rebase all my stuff
off of that.

--D

> 
> Thanks,
> Eryu
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel


Re: [Ocfs2-devel] [PATCH 1/7] ocfs2: test reflinking to inline data files

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 05:01:20PM +0800, Eryu Guan wrote:
> On Sun, Dec 11, 2016 at 01:52:51PM -0800, Darrick J. Wong wrote:
> > Make sure that we can handle reflinking from and to inline-data files.
> > 
> > Signed-off-by: Darrick J. Wong 
> > ---
> >  common/reflink   |2 +
> >  tests/ocfs2/001  |   88 
> > ++
> >  tests/ocfs2/001.out  |   14 
> >  tests/ocfs2/Makefile |   20 +++
> >  tests/ocfs2/group|1 +
> >  5 files changed, 124 insertions(+), 1 deletion(-)
> >  create mode 100755 tests/ocfs2/001
> >  create mode 100644 tests/ocfs2/001.out
> >  create mode 100644 tests/ocfs2/Makefile
> >  create mode 100644 tests/ocfs2/group
> > 
> > 
> > diff --git a/common/reflink b/common/reflink
> > index 9d51729..d048045 100644
> > --- a/common/reflink
> > +++ b/common/reflink
> > @@ -197,7 +197,7 @@ _cp_reflink() {
> > file1="$1"
> > file2="$2"
> >  
> > -   cp --reflink=always -p "$file1" "$file2"
> > +   cp --reflink=always -p -f "$file1" "$file2"
> 
> I'm still seeing "File exists" error with this patch, tested with your
> ocfs2-vfs-reflink-6 branch, compiled on openSUSE Tumbleweed.
> 
> FSTYP -- ocfs2
> PLATFORM  -- Linux/x86_64 bootp-73-5-234 4.9.0-rc8.djwong-ocfs2+
> MKFS_OPTIONS  -- --fs-features=local /dev/sda5
> MOUNT_OPTIONS -- /dev/sda5 /mnt/testarea/scratch
> 
> ocfs2/001- output mismatch (see 
> /root/xfstests/results//ocfs2/ocfs2/001.out.bad)
> --- tests/ocfs2/001.out 2016-12-12 13:51:38.053909486 +0800
> +++ /root/xfstests/results//ocfs2/ocfs2/001.out.bad 2016-12-12 
> 16:49:35.038882697 +0800
> @@ -1,14 +1,18 @@
>  QA output created by 001
> +mkfs.ocfs2 1.8.4

I guess I'll have to neuter this on newer ocfs2-tools.  (Still running 1.6.4
here).

>  Format and mount
>  Create the original files
>  reflink into the start of file2
> +cp: failed to reflink '/mnt/testarea/scratch/test-001/file2' from 
> '/mnt/testarea/scratch/test-001/file1': File exists
>  reflink past the stuff in file3
> ...
> (Run 'diff -u tests/ocfs2/001.out 
> /root/xfstests/results//ocfs2/ocfs2/001.out.bad'  to see the entire diff)
> 
> --- tests/ocfs2/001.out 2016-12-12 13:51:38.053909486 +0800
> +++ /root/xfstests/results//ocfs2/ocfs2/001.out.bad 2016-12-12 
> 16:44:31.991943842 +0800
> @@ -1,14 +1,18 @@
>  QA output created by 001
> +mkfs.ocfs2 1.8.4
>  Format and mount
>  Create the original files
>  reflink into the start of file2
> +cp: failed to reflink '/mnt/testarea/scratch/test-001/file2' from 
> '/mnt/testarea/scratch/test-001/file1': File exists
>  reflink past the stuff in file3
>  reflink an inline-data file to a regular one
> +cp: failed to reflink '/mnt/testarea/scratch/test-001/file5' from 
> '/mnt/testarea/scratch/test-001/file4': File exists
>  reflink an inline-data file to another inline-data file
> +cp: failed to reflink '/mnt/testarea/scratch/test-001/file6' from 
> '/mnt/testarea/scratch/test-001/file4': File exists
>  Verify the whole mess
>  2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-001/file1
> -2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-001/file2
> +401b30e3b8b5d629635a5c613cdb7919  SCRATCH_MNT/test-001/file2
>  4e68a2e24b6b0f386ab39d01d902293d  SCRATCH_MNT/test-001/file3
>  009520053b00386d1173f3988c55d192  SCRATCH_MNT/test-001/file4
> -009520053b00386d1173f3988c55d192  SCRATCH_MNT/test-001/file5
> -009520053b00386d1173f3988c55d192  SCRATCH_MNT/test-001/file6
> +2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-001/file5
> +60b725f10c9c85c70d97880dfe8191b3  SCRATCH_MNT/test-001/file6
> 
> I did the "reflink into the start of file2" test manually, and strace
> showed that it is file1 reports EEXIST.
> 
> open("/mnt/ocfs2/testfile1", O_RDONLY)  = 3
> fstat(3, {st_mode=S_IFREG|0600, st_size=65536, ...}) = 0
> ioctl(3, _IOC(_IOC_WRITE, 0x6f, 0x04, 0x18), 0x7ffc8daf09f0) = -1 EEXIST 
> (File exists)

Wait, that's the ocfs2 reflink ioctl, not FICLONE.  Well that explains
why the functional parts of the tests fail.  I looked at latest coreutils
source, which does not use OCFS2_IOC_REFLINK, so I guess this must be an
opensuse thing?

--D

> 
> The same test on XFS works fine. Did I miss anything?
> 
> Thanks,
> Eryu

___
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel