zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 00/10] ocfs2-test: some cleanup and bug fixes
Hi, There're some cleanup and bug fixes for ocfs2 test project. Considering that test project has been inactive for long time, I also send them to user and tools mail list, in order to reach more developers. Look for feedbacks from you. BTW, if you also hold some good patches, please share them!
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 01/10] Use pkg-config to determine linking flags for libocfs2
From: Goldwyn Rodrigues <rgoldwyn at suse.com> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com> Reviewed-by: Eric Ren <zren at suse.com> --- programs/inline-data/Makefile | 9 +++++---- programs/truncate/ocfs2-tools/Makefile | 3 ++- programs/tunefs-test/remove-slot/Makefile | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/programs/inline-data/Makefile b/programs/inline-data/Makefile index 4bfd809..8b14e2d 100644 --- a/programs/inline-data/Makefile +++ b/programs/inline-data/Makefile @@ -7,6 +7,7 @@ TESTS = inline-data inline-dirs multi-inline-data multi-inline-dirs CFLAGS = -O2 -Wall -g MPI_LINK = $(MPICC) $(CFLAGS) $(LDFLAGS) -o $@ $^ +OCFS2_LIBS = `pkg-config --cflags --libs ocfs2` SOURCES = inline-data.c inline-dirs.c inline-data-utils.c inline-dirs-utils.c multi-inline-data.c multi-inline-dirs.c OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) @@ -18,10 +19,10 @@ BIN_PROGRAMS = inline-data inline-dirs multi-inline-data multi-inline-dirs BIN_EXTRA = single-inline-run.sh multi-inline-run.sh inline-data: inline-data.o inline-data-utils.o - $(LINK) -locfs2 + $(LINK) $(OCFS2_LIBS) inline-dirs: inline-dirs.o inline-dirs-utils.o - $(LINK) -locfs2 + $(LINK) $(OCFS2_LIBS) multi-inline-data.o: multi-inline-data.c $(MPICC) -c multi-inline-data.c @@ -30,9 +31,9 @@ multi-inline-dirs.o: multi-inline-dirs.c $(MPICC) -c multi-inline-dirs.c multi-inline-data: multi-inline-data.o inline-data-utils.o - $(MPI_LINK) -locfs2 + $(MPI_LINK) $(OCFS2_LIBS) multi-inline-dirs: multi-inline-dirs.o - $(MPI_LINK) -locfs2 + $(MPI_LINK) $(OCFS2_LIBS) include $(TOPDIR)/Postamble.make diff --git a/programs/truncate/ocfs2-tools/Makefile b/programs/truncate/ocfs2-tools/Makefile index 63fa817..18f54a9 100644 --- a/programs/truncate/ocfs2-tools/Makefile +++ b/programs/truncate/ocfs2-tools/Makefile @@ -5,6 +5,7 @@ include $(TOPDIR)/Preamble.make TESTS = test_truncate CFLAGS = -O2 -Wall -g +OCFS2_LIBS=`pkg-config --cflags --libs ocfs2` SOURCES = test_truncate.c OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) @@ -16,6 +17,6 @@ BIN_PROGRAMS = test_truncate BIN_EXTRA = ocfs2_truncate.sh test_truncate: $(OBJECTS) - $(LINK) -locfs2 -lcom_err + $(LINK) $(OCFS2_LIBS) include $(TOPDIR)/Postamble.make diff --git a/programs/tunefs-test/remove-slot/Makefile b/programs/tunefs-test/remove-slot/Makefile index 97226ea..dc17c66 100644 --- a/programs/tunefs-test/remove-slot/Makefile +++ b/programs/tunefs-test/remove-slot/Makefile @@ -5,6 +5,7 @@ include $(TOPDIR)/Preamble.make TESTS = remove_slot CFLAGS = -O2 -Wall -g +OCFS2_LIBS=`pkg-config --cflags --libs ocfs2` SOURCES = remove_slot.c OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) @@ -16,6 +17,6 @@ BIN_PROGRAMS = remove_slot BIN_EXTRA = remove_slot.sh corrupt_remove_slot.sh remove_slot: $(OBJECTS) - $(LINK) -locfs2 -lcom_err + $(LINK) $(OCFS2_LIBS) include $(TOPDIR)/Postamble.make -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 02/10] Remove splice() from api-compat
From: Goldwyn Rodrigues <rgoldwyn at suse.com> splice() is available in later kernels and is not required. Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com> Reviewed-by: Eric Ren <zren at suse.com> --- api-compat/include/splice.h | 37 ------------------------------------- configure.in | 5 ----- 2 files changed, 42 deletions(-) delete mode 100644 api-compat/include/splice.h diff --git a/api-compat/include/splice.h b/api-compat/include/splice.h deleted file mode 100644 index 08966c1..0000000 --- a/api-compat/include/splice.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef API_SPLICE_H -#define API_SPLICE_H - -#include <unistd.h> -#include <fcntl.h> - -#if defined(__i386__) - -#define __NR_splice 313 - -#elif defined(__x86_64__) - -#define __NR_splice 275 - -#elif defined(__powerpc__) - -#define __NR_splice 283 - -#elif defined(__s390__) - -#define __NR_splice 306 - -#elif defined(__ia64__) - -#define __NR_splice 1297 - -#else -#error unsupported arch -#endif - -int splice(int fdin, loff_t *off_in, int fdout, - loff_t *off_out, size_t len, unsigned int flags) -{ - return syscall(__NR_splice, fdin, off_in, fdout, off_out, len, flags); -} - -#endif diff --git a/configure.in b/configure.in index ef54d37..57800d7 100644 --- a/configure.in +++ b/configure.in @@ -130,11 +130,6 @@ AM_PATH_PYTHON(2.3, , AC_MSG_ERROR([could not find Python 2.3 or higher.])) API_COMPAT_HEADERS="" API_COMPAT_CFLAGS="" -splice_compat_header="" -OCFS2_CHECK_HEADERS([splice() in bits/fcntl.h], bits/fcntl.h, - , splice_compat_header="splice.h", [splice (int __fdin]) -API_COMPAT_HEADERS="$API_COMPAT_HEADERS $splice_compat_header" - NO_REFLINK OCFS2_CHECK_HEADERS([reflink() in unistd.h], unistd.h, , NO_REFLINK=yes, [reflink]) -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 03/10] Fix function prototypes
From: Goldwyn Rodrigues <rgoldwyn at suse.com> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com> Reviewed-by: Eric Ren <zren at suse.com> --- programs/quota_tests/quota_multi_tests.c | 9 +++++---- programs/xattr_tests/xattr-test.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/quota_tests/quota_multi_tests.c b/programs/quota_tests/quota_multi_tests.c index fa31735..350d3cb 100755 --- a/programs/quota_tests/quota_multi_tests.c +++ b/programs/quota_tests/quota_multi_tests.c @@ -185,6 +185,7 @@ static int name2id(int type, char *name) return user2uid(name); if (type & GROUP) return group2gid(name); + return -1; } static void MPI_Barrier_Sync(void) @@ -1089,7 +1090,7 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, add_rm_user_group(GROUPDEL_BIN, REMOVE, GROUP, groupname, NULL); } -static int quota_corrupt_test(long isoftlimit, long bsoftlimit, int user_postfix) +static void quota_corrupt_test(long isoftlimit, long bsoftlimit, int user_postfix) { int ret, fd; long i, j; @@ -1155,7 +1156,7 @@ static int quota_corrupt_test(long isoftlimit, long bsoftlimit, int user_postfix add_rm_user_group(USERDEL_BIN, REMOVE, USER, username, NULL); } -static int concurrent_rw_test(long isoftlimit, long bsoftlimit, +static void concurrent_rw_test(long isoftlimit, long bsoftlimit, long user_postfix) { int ret, fd, o_uid, j; @@ -1250,7 +1251,7 @@ static int concurrent_rw_test(long isoftlimit, long bsoftlimit, } } -static int run_tests(void) +static void run_tests(void) { int ret; int i; @@ -1346,7 +1347,7 @@ static int run_tests(void) } -static int setup(int argc, char *argv[]) +static void setup(int argc, char *argv[]) { unsigned long i; int ret; diff --git a/programs/xattr_tests/xattr-test.c b/programs/xattr_tests/xattr-test.c index 3b5af28..2e58ee2 100755 --- a/programs/xattr_tests/xattr-test.c +++ b/programs/xattr_tests/xattr-test.c @@ -355,7 +355,7 @@ static void atexit_hook(void) free(child_pid_list); } -static int one_round_run(enum FILE_TYPE ft, int round_no) +static void one_round_run(enum FILE_TYPE ft, int round_no) { int fd, ret, status; DIR *dp; -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 04/10] Fix compilation issues with the programs unused variables, incorrect printf format, char array usage etc.
From: Goldwyn Rodrigues <rgoldwyn at suse.com> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com> Reviewed-by: Eric Ren <zren at suse.com> --- programs/aio-stress/aio-stress.c | 17 +++-- .../check_file_size_limits.c | 2 +- programs/directio_test/directio.h | 3 + programs/discontig_bg_test/gen_extents.c | 3 +- programs/extend_and_write/verify.c | 1 + programs/extendo/extendo.c | 4 +- programs/inline-data/inline-data-utils.c | 8 +-- programs/inline-data/inline-data.c | 5 +- programs/inline-data/inline-dirs-utils.c | 4 +- programs/inline-data/inline-dirs.c | 10 +-- programs/multi_node_mmap/multi_mmap.c | 2 - programs/quota_tests/quota_multi_tests.c | 80 ++++++++++------------ programs/reserve_space/reserve_space.c | 4 +- programs/truncate/verify_truncate.c | 6 +- programs/xattr_tests/xattr-test-utils.c | 30 ++++---- programs/xattr_tests/xattr-test.c | 13 ++-- 16 files changed, 97 insertions(+), 95 deletions(-) diff --git a/programs/aio-stress/aio-stress.c b/programs/aio-stress/aio-stress.c index 91af264..fd38b66 100644 --- a/programs/aio-stress/aio-stress.c +++ b/programs/aio-stress/aio-stress.c @@ -1170,7 +1170,7 @@ restart: if (t->stage_mb_trans && t->num_files > 0) { double seconds = time_since_now(&stage_time); - fprintf(stderr, "thread %d %s totals (%.2f MB/s) %.2f MB in %.2fs\n", + fprintf(stderr, "thread %ld %s totals (%.2f MB/s) %.2f MB in %.2fs\n", t - global_thread_info, this_stage, t->stage_mb_trans/seconds, t->stage_mb_trans, seconds); } @@ -1452,16 +1452,21 @@ int main(int ac, char **av) if (file_size < num_contexts * context_offset) { fprintf(stderr, "file size %Lu too small for %d contexts\n", - file_size, num_contexts); + (unsigned long long)file_size, num_contexts); exit(1); } - fprintf(stderr, "file size %LuMB, record size %luKB, depth %d, ios per iteration %d\n", file_size / (1024 * 1024), rec_len / 1024, depth, io_iter); + fprintf(stderr, "file size %LuMB, record size %luKB, depth %d, ios " + "per iteration %d\n", + (unsigned long long) file_size / (1024 * 1024), + rec_len / 1024, depth, io_iter); fprintf(stderr, "max io_submit %d, buffer alignment set to %luKB\n", max_io_submit, (page_size_mask + 1)/1024); - fprintf(stderr, "threads %d files %d contexts %d context offset %LuMB verification %s\n", - num_threads, num_files, num_contexts, - context_offset / (1024 * 1024), verify ? "on" : "off"); + fprintf(stderr, "threads %d files %d contexts %d context offset " + "%LuMB verification %s\n", + num_threads, num_files, num_contexts, + (unsigned long long) context_offset / (1024 * 1024), + verify ? "on" : "off"); /* open all the files and do any required setup for them */ for (i = optind ; i < ac ; i++) { int thread_index; diff --git a/programs/check_file_size_limits/check_file_size_limits.c b/programs/check_file_size_limits/check_file_size_limits.c index 04664e2..22e69c7 100644 --- a/programs/check_file_size_limits/check_file_size_limits.c +++ b/programs/check_file_size_limits/check_file_size_limits.c @@ -220,7 +220,7 @@ static int write_at_largest_off(int fd, unsigned long long max_off) int main(int argc, char **argv) { int fd, ret; - unsigned int bbits = 0, cbits = 0; + int bbits = 0, cbits = 0; char *fname = NULL; unsigned long long max_off; diff --git a/programs/directio_test/directio.h b/programs/directio_test/directio.h index fa02b1c..f2fe228 100755 --- a/programs/directio_test/directio.h +++ b/programs/directio_test/directio.h @@ -26,6 +26,9 @@ #include <fcntl.h> #include <signal.h> #include <linux/types.h> +#include <sys/stat.h> +#include <unistd.h> + #include <linux/limits.h> #include <sys/time.h> #include <sys/sem.h> diff --git a/programs/discontig_bg_test/gen_extents.c b/programs/discontig_bg_test/gen_extents.c index 8ce9ae2..ab4626a 100755 --- a/programs/discontig_bg_test/gen_extents.c +++ b/programs/discontig_bg_test/gen_extents.c @@ -68,6 +68,7 @@ int parse_opts(int argc, char **argv) filesize = 0; enable_multi_nodes = 0; + filename[0]='\0'; while (1) { c = getopt(argc, argv, "f:l:c:k:mh:"); @@ -98,7 +99,7 @@ int parse_opts(int argc, char **argv) } } - if (!filename) { + if (filename[0]=='\0') { fprintf(stderr, "filename is a mandatory option\n"); usage(); } diff --git a/programs/extend_and_write/verify.c b/programs/extend_and_write/verify.c index 0dbb0ba..5c1d6c3 100644 --- a/programs/extend_and_write/verify.c +++ b/programs/extend_and_write/verify.c @@ -1,5 +1,6 @@ #include <unistd.h> #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> diff --git a/programs/extendo/extendo.c b/programs/extendo/extendo.c index 399a7f0..825687e 100644 --- a/programs/extendo/extendo.c +++ b/programs/extendo/extendo.c @@ -52,7 +52,7 @@ int main(int argc, char **argv) printf("error %d: %s\n", errno, strerror(errno)); exit(1); } - printf("seek to end at offset %llu\n", off); + printf("seek to end at offset %llu\n", (unsigned long long)off); strcpy(buf, "123456789"); ts.tv_sec = (wait/1000); @@ -74,7 +74,7 @@ int main(int argc, char **argv) } printf("write succeeded at offset %lld... sleeping %d ms...\n", - off, wait); + (long long int) off, wait); ret = nanosleep(&ts, &rem); if (ret == -1) { diff --git a/programs/inline-data/inline-data-utils.c b/programs/inline-data/inline-data-utils.c index 0e1489e..9bec975 100644 --- a/programs/inline-data/inline-data-utils.c +++ b/programs/inline-data/inline-data-utils.c @@ -109,7 +109,6 @@ int extend_pattern(int fd, unsigned int old_size, unsigned int new_size) { int bytes = new_size - old_size; int ret; - int i; memset(pattern + old_size, 0, bytes); @@ -210,7 +209,8 @@ int write_at(int fd, const void *buf, size_t count, off_t offset) } if (ret != count) { - fprintf(stderr, "Short write: wanted %d, got %d\n", count, ret); + fprintf(stderr, "Short write: wanted %lu, got %d\n", + (unsigned long) count, ret); return -1; } @@ -432,7 +432,7 @@ int should_inlined_or_not(int is_inlined, int should_inlined, int test_no) if (!is_inlined) { fprintf(stderr, "After Test #%d, file %s should be " "inlined here!\n", test_no, file_name); - fprintf(stderr, "File(%s): i_size = %d,id_count = %d\n", + fprintf(stderr, "File(%s): i_size = %ld,id_count = %u\n", file_name, i_size, id_count); return -1; } @@ -441,7 +441,7 @@ int should_inlined_or_not(int is_inlined, int should_inlined, int test_no) if (is_inlined) { fprintf(stderr, "After Test #%d, file %s should be " "extented here!\n", test_no, file_name); - fprintf(stderr, "File(%s): i_size = %d,id_count = %d\n", + fprintf(stderr, "File(%s): i_size = %ld,id_count = %u\n", file_name, i_size, id_count); return -1; diff --git a/programs/inline-data/inline-data.c b/programs/inline-data/inline-data.c index 6bf40f7..13124d7 100644 --- a/programs/inline-data/inline-data.c +++ b/programs/inline-data/inline-data.c @@ -234,8 +234,8 @@ static int setup(int argc, char *argv[]) mount_point, WORK_PLACE); mkdir(work_place, FILE_MODE); - printf("BlockSize:\t\t%d\nMax Inline Data Size:\t%d\n" - "ClusterSize:\t\t%d\nPageSize:\t\t%d\nWorkingPlace:\t\t%s\n\n", + printf("BlockSize:\t\t%u\nMax Inline Data Size:\t%d\n" + "ClusterSize:\t\t%lu\nPageSize:\t\t%lu\nWorkingPlace:\t\t%s\n\n", blocksize, max_inline_size, clustersize, page_size, work_place); return 0; @@ -902,7 +902,6 @@ static int test_regular_file(int test_no) test_num++; } -bail: printf("All File I/O Tests Passed\n"); unlink(file_name); diff --git a/programs/inline-data/inline-dirs-utils.c b/programs/inline-data/inline-dirs-utils.c index e0d0545..3683452 100644 --- a/programs/inline-data/inline-dirs-utils.c +++ b/programs/inline-data/inline-dirs-utils.c @@ -572,7 +572,7 @@ void should_inlined_or_not(int is_inlined, int should_inlined, int test_no) if (!is_inlined) { fprintf(stderr, "After Test #%d, dir %s should be " "inlined here!\n", test_no, dir_name); - fprintf(stderr, "Dir(%s): i_size = %d,id_count = %d\n", + fprintf(stderr, "Dir(%s): i_size = %lu,id_count = %d\n", dir_name, i_size, id_count); exit(-1); } @@ -581,7 +581,7 @@ void should_inlined_or_not(int is_inlined, int should_inlined, int test_no) if (is_inlined) { fprintf(stderr, "After Test #%d, dir %s should be " "extented here!\n", test_no, dir_name); - fprintf(stderr, "Dir(%s): i_size = %d,id_count = %d\n", + fprintf(stderr, "Dir(%s): i_size = %lu,id_count = %d\n", dir_name, i_size, id_count); exit(-1); diff --git a/programs/inline-data/inline-dirs.c b/programs/inline-data/inline-dirs.c index d7a4510..0fb5fd6 100644 --- a/programs/inline-data/inline-dirs.c +++ b/programs/inline-data/inline-dirs.c @@ -309,7 +309,7 @@ static void run_large_dir_tests(void) should_inlined_or_not(ret, 0, testno); /*verify i_size should be one block size here*/ if (i_size != blocksize) { - fprintf(stderr, "i_size should be %d,while it's % here!\n", + fprintf(stderr, "i_size should be %d,while it's %lu here!\n", blocksize, i_size); } destroy_dir(); @@ -328,7 +328,7 @@ static void run_large_dir_tests(void) should_inlined_or_not(ret, 0, testno); /*verify i_size should be one block size here*/ if (i_size != blocksize * 2) { - fprintf(stderr, "i_size should be %d,while it's % here!\n", + fprintf(stderr, "i_size should be %d,while it's %lu here!\n", blocksize * 2, i_size); } destroy_dir(); @@ -454,7 +454,7 @@ static void del_semvalue(void) static void run_concurrent_test(void) { int ret, rc; - int i, j, status; + int i, status; struct my_dirent *old_dirents; key_t sem_key = IPC_PRIVATE, shm_key = IPC_PRIVATE; @@ -556,7 +556,7 @@ static void run_concurrent_test(void) static void run_multiple_test(void) { - int i, j, status; + int i, status; pid_t pid; int ret, rc; @@ -658,7 +658,7 @@ static void setup(int argc, char *argv[]) snprintf(dir_name, 255, "%s/%s", work_place, dirent_name); printf("BlockSize:\t\t%d\nMax Inline Data Size:\t%d\n" - "ClusterSize:\t\t%d\nPageSize:\t\t%d\nWorkingPlace:\t\t%s\n" + "ClusterSize:\t\t%lu\nPageSize:\t\t%lu\nWorkingPlace:\t\t%s\n" "NumOfMaxInlinedEntries:\t\t%d\n\n", blocksize, max_inline_size, clustersize, page_size, work_place, get_max_inlined_entries(max_inline_size)); diff --git a/programs/multi_node_mmap/multi_mmap.c b/programs/multi_node_mmap/multi_mmap.c index 1ee4dd2..892fc98 100644 --- a/programs/multi_node_mmap/multi_mmap.c +++ b/programs/multi_node_mmap/multi_mmap.c @@ -443,12 +443,10 @@ static void write_verify_blocks(int fd) { int i; unsigned int block; - char *buf = mapped_area + (block*blocksize); for(i = 0; i < num_blocks; i++) { block = i; - buf = mapped_area + (block * blocksize); fill_with_expected_pattern(local_pattern, block); if ((i % num_procs) == rank) diff --git a/programs/quota_tests/quota_multi_tests.c b/programs/quota_tests/quota_multi_tests.c index 350d3cb..7be3f22 100755 --- a/programs/quota_tests/quota_multi_tests.c +++ b/programs/quota_tests/quota_multi_tests.c @@ -523,7 +523,7 @@ static void negative_inodes_limit_test(long isoftlimit, long bsoftlimit, long i, file_index, rm_counts = 0; struct if_dqblk s_dq, d_dq; char username[USERNAME_SZ]; - int *inodes_removed; + int *inodes_removed = NULL; MPI_Request request; MPI_Status status; @@ -532,7 +532,7 @@ static void negative_inodes_limit_test(long isoftlimit, long bsoftlimit, inodes_removed = (int *)malloc(sizeof(int) * isoftlimit * 2); memset((void *)inodes_removed, 0, sizeof(int) * isoftlimit *2); - snprintf(username, USERNAME_SZ, "quota-user-rank%d-%d", rank, + snprintf(username, USERNAME_SZ, "quota-user-rank%d-%ld", rank, user_postfix); add_rm_user_group(USERADD_BIN, ADD, USER, username, NULL); @@ -545,7 +545,7 @@ static void negative_inodes_limit_test(long isoftlimit, long bsoftlimit, s_dq.dqb_curspace = 0; setquota(QUOTAUSER, device, name2id(USER, username), s_dq); } else - snprintf(username, USERNAME_SZ, "quota-user-rank0-%d", + snprintf(username, USERNAME_SZ, "quota-user-rank0-%ld", user_postfix); /* @@ -557,7 +557,7 @@ static void negative_inodes_limit_test(long isoftlimit, long bsoftlimit, o_uid = getuid(); seteuid(name2id(USER, username)); for (i = 0; i < isoftlimit * 2; i++) { - snprintf(filename, PATH_SZ, "%s/%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-quotafile-%ld", workplace, username, i); fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, FILE_MODE); if (fd < 0) { @@ -603,7 +603,7 @@ static void negative_inodes_limit_test(long isoftlimit, long bsoftlimit, while (rm_counts < rm_nums) { i = get_rand(0, isoftlimit * 2 - 1); - snprintf(filename, PATH_SZ, "%s/%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-quotafile-%ld", workplace, username, i); ret = unlink(filename); if (ret < 0) @@ -626,7 +626,7 @@ static void negative_inodes_limit_test(long isoftlimit, long bsoftlimit, file_index = 0; while (file_index < isoftlimit * 2) { if (!inodes_removed[file_index]) { - snprintf(filename, PATH_SZ, "%s/%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-quotafile-%ld", workplace, username, file_index); ret = unlink(filename); } @@ -654,7 +654,7 @@ static void user_inodes_grace_time_test(long isoftlimit, long bsoftlimit, char username[USERNAME_SZ]; - snprintf(username, USERNAME_SZ, "quota-user-rank%d-%d", rank, + snprintf(username, USERNAME_SZ, "quota-user-rank%d-%ld", rank, user_postfix); add_rm_user_group(USERADD_BIN, ADD, USER, username, NULL); @@ -676,7 +676,7 @@ static void user_inodes_grace_time_test(long isoftlimit, long bsoftlimit, seteuid(name2id(USER, username)); for (i = 0; i <= isoftlimit ; i++) { - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, FILE_MODE); if (fd < 0) { @@ -695,7 +695,7 @@ static void user_inodes_grace_time_test(long isoftlimit, long bsoftlimit, /*Grace time take effect from now*/ sleep(grace_seconds); /*grace time expires,so should hit failure here*/ - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, isoftlimit + 1); if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, FILE_MODE)) > 0) { close(fd); @@ -706,7 +706,7 @@ static void user_inodes_grace_time_test(long isoftlimit, long bsoftlimit, seteuid(o_uid); for (i = 0; i <= isoftlimit; i++) { - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); ret = unlink(filename); if (ret < 0) { @@ -722,11 +722,9 @@ static void user_inodes_grace_time_test(long isoftlimit, long bsoftlimit, static void user_space_limit_test(long isoftlimit, long bsoftlimit, int user_postfix) { - int ret; - long i; - int fd; + int ret, fd; int o_uid; - struct if_dqblk s_dq, d_dq; + struct if_dqblk s_dq; char *write_buf; int writen_sz = 0; long file_sz = 0; @@ -822,7 +820,7 @@ static void user_inodes_limit_test(long isoftlimit, long bsoftlimit, int user_po } for (i = 0; i < isoftlimit * 2; i++) { - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); if (!(i % 2)) { fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, FILE_MODE); @@ -837,12 +835,12 @@ static void user_inodes_limit_test(long isoftlimit, long bsoftlimit, int user_po getquota(QUOTAUSER, device, name2id(USER, username), &d_dq); if (d_dq.dqb_curinodes != i + 1) abort_printf("Incorrect quota stats found,expected " - "inode_num = %d,queried inode_num = %d.\n", + "inode_num = %ld,queried inode_num = %d.\n", i + 1, d_dq.dqb_curinodes); } /*We definitely should hit falure here*/ - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, isoftlimit * 2); if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, FILE_MODE)) > 0) { @@ -853,7 +851,7 @@ static void user_inodes_limit_test(long isoftlimit, long bsoftlimit, int user_po /*cleanup*/ seteuid(o_uid); for (i = 0; i < isoftlimit * 2; i++) { - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); if (!(i % 2)) { ret = unlink(filename); @@ -879,10 +877,10 @@ static void user_inodes_limit_test(long isoftlimit, long bsoftlimit, int user_po static void group_space_limit_test(long isoftlimit, long bsoftlimit, long user_num, int grp_postfix) { - int ret, fd; - long i, j; + int ret = 0, fd; + long i; int o_uid, o_gid; - struct if_dqblk s_dq, d_dq; + struct if_dqblk s_dq; char username[USERNAME_SZ], groupname[GROUPNAME_SZ]; char *write_buf; @@ -908,7 +906,7 @@ static void group_space_limit_test(long isoftlimit, long bsoftlimit, setegid(name2id(GROUP, groupname)); for (i = 0; i < user_num; i++) { - snprintf(username, USERNAME_SZ, "%s-quotauser-%d", groupname, i); + snprintf(username, USERNAME_SZ, "%s-quotauser-%ld", groupname, i); add_rm_user_group(USERADD_BIN, ADD, USER_IN_GROUP, username, groupname); getquota(QUOTAUSER, device, name2id(USER, username), &s_dq); @@ -966,7 +964,7 @@ static void group_space_limit_test(long isoftlimit, long bsoftlimit, setegid(o_gid); for (i = 0; i < user_num; i++) { - snprintf(username, USERNAME_SZ, "%s-quotauser-%d", groupname, i); + snprintf(username, USERNAME_SZ, "%s-quotauser-%ld", groupname, i); snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-group-spacelimit", workplace, hostname, username); ret = unlink(filename); @@ -990,7 +988,7 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, long user_num, int grp_postfix) { int ret, fd; - long i, j; + long i; int o_uid, o_gid; int user_index; struct if_dqblk s_dq, d_dq; @@ -1011,7 +1009,7 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, setquota(QUOTAGROUP, device, name2id(GROUP, groupname), s_dq); for (i = 0; i < user_num; i++) { - snprintf(username, USERNAME_SZ, "%s-quotauser-%d", groupname, i); + snprintf(username, USERNAME_SZ, "%s-quotauser-%ld", groupname, i); add_rm_user_group(USERADD_BIN, ADD, USER_IN_GROUP, username, groupname); getquota(QUOTAUSER, device, name2id(USER, username), &s_dq); @@ -1031,7 +1029,7 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, user_index = i % user_num; snprintf(username, USERNAME_SZ, "%s-quotauser-%d", groupname, user_index); - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); o_uid = getuid(); seteuid(name2id(USER, username)); @@ -1054,7 +1052,7 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, /*We definitely should hit falure here*/ user_index = (isoftlimit * 2) % user_num; snprintf(username, USERNAME_SZ, "%s-quotauser-%d", groupname, user_index); - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, isoftlimit * 2); o_uid = getuid(); seteuid(name2id(USER, username)); @@ -1071,7 +1069,7 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, user_index = i % user_num; snprintf(username, USERNAME_SZ, "%s-quotauser-%d", groupname, user_index); - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); ret = unlink(filename); if (ret < 0) { @@ -1083,7 +1081,7 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, } for (i = 0; i < user_num; i++) { - snprintf(username, USERNAME_SZ, "%s-quotauser-%d", groupname, i); + snprintf(username, USERNAME_SZ, "%s-quotauser-%ld", groupname, i); add_rm_user_group(USERDEL_BIN, REMOVE, USER, username, NULL); } @@ -1093,12 +1091,10 @@ static void group_inodes_limit_test(long isoftlimit, long bsoftlimit, static void quota_corrupt_test(long isoftlimit, long bsoftlimit, int user_postfix) { int ret, fd; - long i, j; - int o_uid, o_gid; - int user_index; + long i; + int o_uid; struct if_dqblk s_dq, d_dq; - - char username[USERNAME_SZ], groupname[GROUPNAME_SZ]; + char username[USERNAME_SZ]; snprintf(username, USERNAME_SZ, "quotauser-rank%d-%d", rank, user_postfix); @@ -1117,7 +1113,7 @@ static void quota_corrupt_test(long isoftlimit, long bsoftlimit, int user_postfi ret = seteuid(name2id(USER, username)); for (i = 0; i < isoftlimit; i++) { - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, FILE_MODE); @@ -1143,7 +1139,7 @@ static void quota_corrupt_test(long isoftlimit, long bsoftlimit, int user_postfi d_dq.dqb_curinodes); for (i = 0; i < isoftlimit; i++) { - snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%d", + snprintf(filename, PATH_SZ, "%s/%s-%s-quotafile-%ld", workplace, hostname, username, i); ret = unlink(filename); if (ret < 0) { @@ -1159,8 +1155,8 @@ static void quota_corrupt_test(long isoftlimit, long bsoftlimit, int user_postfi static void concurrent_rw_test(long isoftlimit, long bsoftlimit, long user_postfix) { - int ret, fd, o_uid, j; - long i, file_index, writen_size = 0; + int ret, fd, o_uid; + long i, writen_size = 0; struct if_dqblk s_dq, d_dq; char username[USERNAME_SZ]; char *write_buf; @@ -1170,7 +1166,7 @@ static void concurrent_rw_test(long isoftlimit, long bsoftlimit, if (!rank) { - snprintf(username, USERNAME_SZ, "quota-user-rank%d-%d", rank, + snprintf(username, USERNAME_SZ, "quota-user-rank%d-%ld", rank, user_postfix); add_rm_user_group(USERADD_BIN, ADD, USER, username, NULL); @@ -1184,7 +1180,7 @@ static void concurrent_rw_test(long isoftlimit, long bsoftlimit, setquota(QUOTAUSER, device, name2id(USER, username), s_dq); } else - snprintf(username, USERNAME_SZ, "quota-user-rank0-%d", + snprintf(username, USERNAME_SZ, "quota-user-rank0-%ld", user_postfix); if (!rank) { o_uid = getuid(); @@ -1253,10 +1249,7 @@ static void concurrent_rw_test(long isoftlimit, long bsoftlimit, static void run_tests(void) { - int ret; int i; - int fd; - int o_uid, o_gid; struct if_dqblk s_dq, d_dq; char username[USERNAME_SZ], groupname[GROUPNAME_SZ]; @@ -1349,7 +1342,6 @@ static void run_tests(void) static void setup(int argc, char *argv[]) { - unsigned long i; int ret; int o_umask; diff --git a/programs/reserve_space/reserve_space.c b/programs/reserve_space/reserve_space.c index 9e91b09..1bffd9e 100644 --- a/programs/reserve_space/reserve_space.c +++ b/programs/reserve_space/reserve_space.c @@ -45,8 +45,8 @@ usage: printf("File: %s\n", filename); printf("cmd = %s\n", argv[1]); printf("l_whence = %d\n", sr.l_whence); - printf("l_start = %lld\n", sr.l_start); - printf("l_len = %lld\n", sr.l_len); + printf("l_start = %lld\n", (long long int) sr.l_start); + printf("l_len = %lld\n", (long long int) sr.l_len); fd = open(filename, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (fd == -1) { diff --git a/programs/truncate/verify_truncate.c b/programs/truncate/verify_truncate.c index 175305f..37d4236 100644 --- a/programs/truncate/verify_truncate.c +++ b/programs/truncate/verify_truncate.c @@ -222,7 +222,7 @@ int file_truncate(char *file_name, unsigned long long new_i_size) int verify_truncate(char *file_name) { - int fd, ret = 0, o_ret; + int fd, ret = 0; int open_ro_flags = O_RDONLY; long i; @@ -261,8 +261,8 @@ int verify_truncate(char *file_name) } if (memcmp(buf, pattern, clustersize)) { - fprintf(stderr, "#%d cluster corrupted on %s.\n", - file_name); + fprintf(stderr, "#%ld cluster corrupted on %s.\n", + i, file_name); ret = -1; goto out; } diff --git a/programs/xattr_tests/xattr-test-utils.c b/programs/xattr_tests/xattr-test-utils.c index 503849a..8cdb537 100644 --- a/programs/xattr_tests/xattr-test-utils.c +++ b/programs/xattr_tests/xattr-test-utils.c @@ -21,6 +21,7 @@ */ #include "xattr-test.h" +#include <time.h> extern char filename[MAX_FILENAME_SZ + 1]; extern unsigned long xattr_nums; @@ -107,7 +108,7 @@ void xattr_name_generator(unsigned long xattr_no, } xattr_name[xattr_name_rsz - 6] = 0; - snprintf(postfix, 7, "%06d", xattr_no); + snprintf(postfix, 7, "%06lu", xattr_no); strcat(xattr_name, postfix); strcpy(xattr_name_list_set[xattr_no], xattr_name); } @@ -193,7 +194,7 @@ int is_namelist_member(unsigned long nu, char *name, char **name_list) int read_ea(enum FILE_TYPE ft, int fd) { - int ret; + int ret = 0; switch (ft) { case NORMAL: @@ -237,7 +238,7 @@ int read_ea(enum FILE_TYPE ft, int fd) int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags, const char *prt_str) { - int ret; + int ret = 0; switch (ft) { case NORMAL: @@ -246,9 +247,10 @@ int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags, if (ret < 0) { ret = errno; fprintf(stderr, "Failed at fsetxattr(%s,errno:%d,%s) " - "on %s:xattr_name=%s,xattr_value_sz=%d," + "on %s:xattr_name=%s,xattr_value_sz=%llu," "xattr_value=%s\n", prt_str, ret, strerror(ret), - filename, xattr_name, strlen(xattr_value) + 1, + filename, xattr_name, + (unsigned long long) strlen(xattr_value) + 1, xattr_value); ret = -1; } @@ -259,9 +261,10 @@ int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags, if (ret < 0) { ret = errno; fprintf(stderr, "Failed at lsetxattr(%s,errno:%d,%s) " - "on %s:xattr_name=%s,xattr_value_sz=%d," + "on %s:xattr_name=%s,xattr_value_sz=%llu," "xattr_value=%s\n", prt_str, ret, strerror(ret), - filename, xattr_name, strlen(xattr_value) + 1, + filename, xattr_name, + (unsigned long long)strlen(xattr_value) + 1, xattr_value); ret = -1; } @@ -272,9 +275,10 @@ int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags, if (ret < 0) { ret = errno; fprintf(stderr, "Failed at setxattr(%s,errno:%d,%s) " - "on %s:xattr_name=%s,xattr_value_sz=%d," + "on %s:xattr_name=%s,xattr_value_sz=%llu," "xattr_value=%s\n", prt_str, ret, strerror(ret), - filename, xattr_name, strlen(xattr_value) + 1, + filename, xattr_name, + (unsigned long long)strlen(xattr_value) + 1, xattr_value); ret = -1; } @@ -288,7 +292,7 @@ int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags, int remove_ea(enum FILE_TYPE ft, int fd) { - int ret; + int ret = 0; switch (ft) { case NORMAL: @@ -305,7 +309,7 @@ int remove_ea(enum FILE_TYPE ft, int fd) ret = lremovexattr(filename, xattr_name); if (ret < 0) { ret = errno; - fprintf(stderr, "Failed at lremovexattr(errno:%d,%d) " + fprintf(stderr, "Failed at lremovexattr(errno:%d,%s) " "on %s:xattr_name=%s\n", ret, strerror(ret), filename, xattr_name); ret = -1; @@ -348,9 +352,9 @@ void xattr_value_constructor(int xattr_entry_no) strlen(value_postfix_magic) - strlen(xattr_name) - 5); - snprintf(value_sz, 6, "%05d", strlen(value_prefix_magic) + + snprintf(value_sz, 6, "%05d", (int)(strlen(value_prefix_magic) + strlen(xattr_name) + strlen(xattr_value) + 5 + - strlen(value_postfix_magic)); + strlen(value_postfix_magic))); strcpy(xattr_value_get, value_prefix_magic); strcat(xattr_value_get, xattr_name); diff --git a/programs/xattr_tests/xattr-test.c b/programs/xattr_tests/xattr-test.c index 2e58ee2..90c0ae3 100755 --- a/programs/xattr_tests/xattr-test.c +++ b/programs/xattr_tests/xattr-test.c @@ -311,7 +311,7 @@ static void sigchld_handler() static void kill_all_children() { int i; - int process_nums; + int process_nums = 0; if (do_multi_process_test == 1) process_nums = child_nums; @@ -342,7 +342,7 @@ static void sigterm_handler() static void atexit_hook(void) { int i; - int process_nums; + int process_nums = 0; if (do_multi_process_test == 1) process_nums = child_nums; @@ -357,9 +357,8 @@ static void atexit_hook(void) static void one_round_run(enum FILE_TYPE ft, int round_no) { - int fd, ret, status; - DIR *dp; - pid_t pid, ppid; + int fd = 0, ret, status; + pid_t pid; unsigned long j; int i, k; char *write_buf = NULL; @@ -611,7 +610,7 @@ static void one_round_run(enum FILE_TYPE ft, int round_no) return; } /* Do normal update/add test*/ - printf("Test %d: Doing normal %d EAs adding and updating on file %s.\n", + printf("Test %d: Doing normal %lu EAs adding and updating on file %s.\n", testno, xattr_nums, filename); fflush(stdout); @@ -671,7 +670,7 @@ static void one_round_run(enum FILE_TYPE ft, int round_no) /*Here we do random_size update and check*/ if (!do_random_test) goto list_test; - printf("Test %d: Doing randomsize updating for %d EAs on file %s.\n", + printf("Test %d: Doing randomsize updating for %lu EAs on file %s.\n", testno, xattr_nums, filename); unsigned long update_iter; -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 05/10] Add library for aio-stress test case.
From: Goldwyn Rodrigues <rgoldwyn at suse.com> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com> Reviewed-by: Eric Ren <zren at suse.com> --- programs/aio-stress/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/aio-stress/Makefile b/programs/aio-stress/Makefile index 9d179e2..5e10e18 100644 --- a/programs/aio-stress/Makefile +++ b/programs/aio-stress/Makefile @@ -14,6 +14,6 @@ OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) DIST_FILES = $(SOURCES) aio-stress: $(OBJECTS) - $(LINK) -laio + $(LINK) -laio -lpthread include $(TOPDIR)/Postamble.make -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 06/10] Cleanup obsolete python timing module
From: Eric Ren <zren at suse.com> "Can not found" the timing module of python error occurs. It's already obsolete and not used anywhere indeed. Signed-off-by: Eric Ren <zren at suse.com> Reviewed-by: Gang He <ghe at suse.com> --- programs/atime_quantum/test_atime_quantum.py | 2 +- programs/buildkernel/buildkernel.py | 2 +- programs/create_files/crfiles.py | 2 +- programs/cross_delete/crdel_del_files.py | 2 +- programs/cross_delete/crdel_gen_files.py | 2 +- programs/cross_delete/cross_delete.py | 2 +- programs/open_delete/open_delete.py | 2 +- programs/recovery_load/recovery_load.py | 2 +- programs/splice/splice_test.py | 2 +- programs/write_torture/write_torture.py | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/programs/atime_quantum/test_atime_quantum.py b/programs/atime_quantum/test_atime_quantum.py index 21d07f1..076c8a8 100755 --- a/programs/atime_quantum/test_atime_quantum.py +++ b/programs/atime_quantum/test_atime_quantum.py @@ -25,7 +25,7 @@ # Author : Marcos E. Matsunaga # -import os, stat, sys, time, optparse, socket, string, o2tf, pdb, timing, config +import os, stat, sys, time, optparse, socket, string, o2tf, pdb, config import random, os.path # # FUNCTIONS START diff --git a/programs/buildkernel/buildkernel.py b/programs/buildkernel/buildkernel.py index 4f0be74..82ad2bc 100755 --- a/programs/buildkernel/buildkernel.py +++ b/programs/buildkernel/buildkernel.py @@ -29,7 +29,7 @@ # E-mail : Marcos.Matsunaga at oracle.com # -import os, sys, time, optparse, socket, string, o2tf, pdb, timing, time, config, platform +import os, sys, time, optparse, socket, string, o2tf, pdb, config, platform # DEBUGON = os.getenv('DEBUG',0) # diff --git a/programs/create_files/crfiles.py b/programs/create_files/crfiles.py index dc78296..130fb18 100755 --- a/programs/create_files/crfiles.py +++ b/programs/create_files/crfiles.py @@ -30,7 +30,7 @@ # E-mail : Marcos.Matsunaga at oracle.com # -import os, sys, time, optparse, socket, string, o2tf, pdb, timing, time, config +import os, sys, time, optparse, socket, string, o2tf, pdb, config # DEBUGON = os.getenv('DEBUG',0) # diff --git a/programs/cross_delete/crdel_del_files.py b/programs/cross_delete/crdel_del_files.py index a7de8d4..d15c185 100755 --- a/programs/cross_delete/crdel_del_files.py +++ b/programs/cross_delete/crdel_del_files.py @@ -26,7 +26,7 @@ # E-mail : Marcos.Matsunaga at oracle.com # -import os, stat, sys, time, optparse, socket, string, o2tf, pdb, timing, config +import os, stat, sys, time, optparse, socket, string, o2tf, pdb, config # #pdb.set_trace() # diff --git a/programs/cross_delete/crdel_gen_files.py b/programs/cross_delete/crdel_gen_files.py index 3691548..9a72f2d 100755 --- a/programs/cross_delete/crdel_gen_files.py +++ b/programs/cross_delete/crdel_gen_files.py @@ -29,7 +29,7 @@ # E-mail : Marcos.Matsunaga at oracle.com # -import os, stat, sys, time, optparse, socket, string, o2tf, pdb, timing, time +import os, stat, sys, time, optparse, socket, string, o2tf, pdb import config # #pdb.set_trace() diff --git a/programs/cross_delete/cross_delete.py b/programs/cross_delete/cross_delete.py index 9582c67..ec3097c 100755 --- a/programs/cross_delete/cross_delete.py +++ b/programs/cross_delete/cross_delete.py @@ -29,7 +29,7 @@ # E-mail : Marcos.Matsunaga at oracle.com # -import os, sys, time, optparse, socket, string, o2tf, config, pdb, timing +import os, sys, time, optparse, socket, string, o2tf, config, pdb import time, config # MAXDIRLEVEL = 64 diff --git a/programs/open_delete/open_delete.py b/programs/open_delete/open_delete.py index d9f12dc..e632cd5 100755 --- a/programs/open_delete/open_delete.py +++ b/programs/open_delete/open_delete.py @@ -27,7 +27,7 @@ # Author : Marcos E. Matsunaga # -import os, stat, sys, time, optparse, socket, string, o2tf, pdb, timing, config +import os, stat, sys, time, optparse, socket, string, o2tf, pdb, config # #pdb.set_trace() # diff --git a/programs/recovery_load/recovery_load.py b/programs/recovery_load/recovery_load.py index a405041..cd721ab 100644 --- a/programs/recovery_load/recovery_load.py +++ b/programs/recovery_load/recovery_load.py @@ -29,7 +29,7 @@ # Author : Marcos E. Matsunaga # # -import os, sys, time, optparse, socket, string, o2tf, config, pdb, timing +import os, sys, time, optparse, socket, string, o2tf, config, pdb import time, config # MAXDIRLEVEL = 64 diff --git a/programs/splice/splice_test.py b/programs/splice/splice_test.py index c3637b0..7282c51 100644 --- a/programs/splice/splice_test.py +++ b/programs/splice/splice_test.py @@ -24,7 +24,7 @@ # Author : Marcos E. Matsunaga # -import os, sys, time, optparse, socket, string, o2tf, config, pdb, timing +import os, sys, time, optparse, socket, string, o2tf, config, pdb import time, config, os.path # MD5SUM = '/usr/bin/md5sum' diff --git a/programs/write_torture/write_torture.py b/programs/write_torture/write_torture.py index ef8cf74..288daeb 100755 --- a/programs/write_torture/write_torture.py +++ b/programs/write_torture/write_torture.py @@ -28,7 +28,7 @@ # Author : Marcos E. Matsunaga # -import os, stat, sys, time, optparse, socket, string, o2tf, pdb, timing, config +import os, stat, sys, time, optparse, socket, string, o2tf, pdb, config import random # #pdb.set_trace() -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 07/10] Handle the problem that the device is a symbolic link which points to a block file.
From: Gang He <ghe at suse.com> Signed-off-by: Gang He <ghe at suse.com> Reviewed--by: Eric Ren <zren at suse.com> --- programs/mkfs-tests/mkfs-test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh index 5d99f86..3fc93a4 100755 --- a/programs/mkfs-tests/mkfs-test.sh +++ b/programs/mkfs-tests/mkfs-test.sh @@ -66,6 +66,10 @@ verify_sizes() { } get_partsz() { + if [ -h "${device}" ]; then + device=`readlink -f "${device}"` + fi + dev=`echo ${device} | sed 's/\/dev\///'` num=`cat /proc/partitions | ${AWK} -v DEV=${dev} ' BEGIN{dev=DEV} // {split($0, a); if (a[4] == dev) {printf("%u\n", $3); exit 0;} }'` -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 08/10] Add missing parameter mpi hosts for multi discontig bg test
From: Eric Ren <zren at suse.com> Signed-off-by: Eric Ren <zren at suse.com> Reviewed-by: Gang He <ghe at suse.com> --- programs/discontig_bg_test/discontig_runner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh index 0f389a4..9f0aeab 100755 --- a/programs/discontig_bg_test/discontig_runner.sh +++ b/programs/discontig_bg_test/discontig_runner.sh @@ -956,7 +956,7 @@ function f_multi_inodes_test() { f_LogMsg ${LOG_FILE} "Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 800 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 800 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 09/10] Trigger udev rescan to get volume label that mkfs made remotely.
From: Eric Ren <zren at suse.com> Volume label used to mount disk remotely is not visible on remote node. So before mounting, trigger udevadm rescan to get volume label. Signed-off-by: Eric Ren <zren at suse.com> Reviewed-by: Gang He <ghe at suse.com> --- programs/python_common/remote_mount.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/programs/python_common/remote_mount.py b/programs/python_common/remote_mount.py index 7520405..088ba46 100755 --- a/programs/python_common/remote_mount.py +++ b/programs/python_common/remote_mount.py @@ -126,8 +126,20 @@ command = str('%s -l %s -m %s %s' % (buildcmd, mt_options)) # o2tf.OpenMPIInit(DEBUGON, options.nodelist, logfile, 'ssh') -# -# + +# tigger udev rescan +ret = o2tf.openmpi_run(DEBUGON, + nproc, + 'udevadm trigger', + options.nodelist, + remote_method, + options.interface, + logfile, + 'WAIT') + +#wait for completing udev rescan.10s is only tested on 3-nodes. +time.sleep(10) + ret = o2tf.openmpi_run(DEBUGON, nproc, str('%s' % command), -- 2.1.4
zren at suse.com
2015-Sep-10 06:54 UTC
[Ocfs2-users] [PATCH 10/10] Replace orte_rsh_agent with plm_rsh_agent
From: Eric Ren <zren at suse.com> Parameter orte_rsh_agent in open MPI is deprecated. Replace with "orte_rsh_agent" and use its default value "ssh:rsh". Signed-off-by: Eric Ren <zren at suse.com> Reviewed-by: He Gang <ghe at suse.com> --- programs/defrag-test/defrag-test.sh | 4 ++-- programs/discontig_bg_test/activate_discontig_bg.sh | 6 +++--- programs/discontig_bg_test/discontig_runner.sh | 6 +++--- programs/dx_dirs_tests/multi_index_dir_run.sh | 2 +- programs/inline-data/multi-inline-run.sh | 4 ++-- programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh | 2 +- programs/python_common/o2tf.py | 8 ++++---- programs/reflink_tests/multi_reflink_test_run.sh | 4 ++-- programs/xattr_tests/xattr-multi-run.sh | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/programs/defrag-test/defrag-test.sh b/programs/defrag-test/defrag-test.sh index 0c8a2fb..8ce5180 100755 --- a/programs/defrag-test/defrag-test.sh +++ b/programs/defrag-test/defrag-test.sh @@ -72,7 +72,7 @@ MULTI_TEST MPI_HOSTS MPI_RANKS MPI_ACCESS_METHOD="rsh" -MPI_PLS_AGENT_ARG="-mca pls_rsh_agent rsh:ssh" +MPI_PLS_AGENT_ARG="-mca pls_rsh_agent ssh:rsh" MPI_BTL_ARG="-mca btl tcp,self" MPI_BTL_IF_ARG @@ -173,7 +173,7 @@ function f_check() } if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca pls_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca pls_rsh_agent ssh:rsh" else MPI_PLS_AGENT_ARG="-mca pls_rsh_agent ssh:rsh" fi diff --git a/programs/discontig_bg_test/activate_discontig_bg.sh b/programs/discontig_bg_test/activate_discontig_bg.sh index 0bb5482..4329247 100755 --- a/programs/discontig_bg_test/activate_discontig_bg.sh +++ b/programs/discontig_bg_test/activate_discontig_bg.sh @@ -59,7 +59,7 @@ MULTI_TEST MPI_HOSTS MPI_RANKS MPI_ACCESS_METHOD="rsh" -MPI_PLS_AGENT_ARG="-mca orte_rsh_agent rsh:ssh" +MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" MPI_BTL_ARG="-mca btl tcp,self" MPI_BTL_IF_ARG ################################################################################ @@ -164,9 +164,9 @@ function f_setup() } if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca orte_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" else - MPI_PLS_AGENT_ARG="-mca orte_rsh_agent ssh:rsh" + MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" fi fi diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh index 9f0aeab..3ee63d1 100755 --- a/programs/discontig_bg_test/discontig_runner.sh +++ b/programs/discontig_bg_test/discontig_runner.sh @@ -56,7 +56,7 @@ MULTI_TEST MPI_HOSTS MPI_RANKS MPI_ACCESS_METHOD="rsh" -MPI_PLS_AGENT_ARG="-mca orte_rsh_agent rsh:ssh" +MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" MPI_BTL_ARG="-mca btl tcp,self" MPI_BTL_IF_ARG ################################################################################ @@ -138,9 +138,9 @@ function f_setup() } if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca orte_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" else - MPI_PLS_AGENT_ARG="-mca orte_rsh_agent ssh:rsh" + MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" fi fi diff --git a/programs/dx_dirs_tests/multi_index_dir_run.sh b/programs/dx_dirs_tests/multi_index_dir_run.sh index 735fc79..eb72a7d 100755 --- a/programs/dx_dirs_tests/multi_index_dir_run.sh +++ b/programs/dx_dirs_tests/multi_index_dir_run.sh @@ -123,7 +123,7 @@ function f_setup() f_getoptions $* if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca pls_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca pls_rsh_agent ssh:rsh" fi if [ -z "${MOUNT_POINT}" ];then diff --git a/programs/inline-data/multi-inline-run.sh b/programs/inline-data/multi-inline-run.sh index ba62aa6..ddd0e4f 100755 --- a/programs/inline-data/multi-inline-run.sh +++ b/programs/inline-data/multi-inline-run.sh @@ -64,7 +64,7 @@ declare -i MPI_RANKS MPI_HOSTS MPI_HOSTFILE MPI_ACCESS_METHOD="ssh" -MPI_PLS_AGENT_ARG="-mca orte_rsh_agent ssh:rsh" +MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" set -o pipefail @@ -168,7 +168,7 @@ f_setup() f_getoptions $* if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca orte_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" REMOTE_SH_BIN=${RSH_BIN} fi diff --git a/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh b/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh index e419961..c54e80f 100755 --- a/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh +++ b/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh @@ -196,7 +196,7 @@ function f_check() f_getoptions $* if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca pls_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca pls_rsh_agent ssh:rsh" fi if [ -z "${MOUNT_POINT}" ];then diff --git a/programs/python_common/o2tf.py b/programs/python_common/o2tf.py index 4da4172..b9b88a9 100644 --- a/programs/python_common/o2tf.py +++ b/programs/python_common/o2tf.py @@ -220,9 +220,9 @@ so just do a sanity check here to test if all nodes are available. nodelen = len(nodelist) if remote_sh == '' or remote_sh == 'ssh': - shopt = '-mca orte_rsh_agent ssh:rsh' + shopt = '-mca plm_rsh_agent ssh:rsh' else: - shopt = '-mca orte_rsh_agent rsh:ssh' + shopt = '-mca plm_rsh_agent ssh:rsh' fd = open(config.MPIHOSTS,'w',0) for i in range(nodelen): @@ -265,9 +265,9 @@ def openmpi_run(DEBUGON, nproc, cmd, nodes, remote_sh, interface, logfile, w_fla iface = '-mca btl_tcp_if_include '+interface if remote_sh == '' or remote_sh == 'ssh': - shopt = '-mca orte_rsh_agent ssh:rsh' + shopt = '-mca plm_rsh_agent ssh:rsh' else: - shopt = '-mca orte_rsh_agent rsh:ssh' + shopt = '-mca plm_rsh_agent ssh:rsh' try: if DEBUGON: printlog('o2tf.mpi_run: MPIRUN = %s' % config.MPIRUN, diff --git a/programs/reflink_tests/multi_reflink_test_run.sh b/programs/reflink_tests/multi_reflink_test_run.sh index 03cea3c..49875b8 100755 --- a/programs/reflink_tests/multi_reflink_test_run.sh +++ b/programs/reflink_tests/multi_reflink_test_run.sh @@ -75,7 +75,7 @@ DEFAULT_RANKS=4 MPI_RANKS MPI_HOSTS MPI_ACCESS_METHOD="ssh" -MPI_PLS_AGENT_ARG="-mca orte_rsh_agent ssh:rsh" +MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" MPI_BTL_ARG="-mca btl tcp,self" MPI_BTL_IF_ARG @@ -140,7 +140,7 @@ function f_setup() f_getoptions $* if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca pls_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca pls_rsh_agent ssh:rsh" fi if [ -z "${MOUNT_POINT}" ];then diff --git a/programs/xattr_tests/xattr-multi-run.sh b/programs/xattr_tests/xattr-multi-run.sh index 98ef0ff..0d49072 100755 --- a/programs/xattr_tests/xattr-multi-run.sh +++ b/programs/xattr_tests/xattr-multi-run.sh @@ -84,7 +84,7 @@ DEFAULT_RANKS=4 declare -i MPI_RANKS MPI_HOSTS MPI_ACCESS_METHOD="ssh" -MPI_PLS_AGENT_ARG="-mca orte_rsh_agent ssh:rsh" +MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" MPI_MCA_BTL="-mca btl tcp,self" MPI_MCA_BTL_IF="" @@ -191,7 +191,7 @@ f_setup() f_getoptions $* if [ "$MPI_ACCESS_METHOD" = "rsh" ];then - MPI_PLS_AGENT_ARG="-mca orte_rsh_agent rsh:ssh" + MPI_PLS_AGENT_ARG="-mca plm_rsh_agent ssh:rsh" REMOTE_SH_BIN=${RSH_BIN} fi -- 2.1.4