* [PATCH 0/8] xfstests: Bunch of new stress tests -v3
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
Changes from v2 ( in request to Christoph's comments)
- rearange patch sequance
- codestyle cleanups
- give better description
- add tunable mask for FS_IOC_SETFLAGS test.
LOG:
# Following patches improves fsstress logging
xfstests: fsstress dump inode info when possible
xfstests: add different logging option to fsstress
# Following patch makes fsstress more manageable
xfstests: fsstress should kill children tasks before exit
# Following patches add new tests
xfstests: add fallocate support to fsstress
xfstests: fsstress add FS_IOC_{SET,GET}FLAGS operations v2
xfstests: add fiemap operation to fsstress
# Following testcase may fail on recent kernel in case of ext4
# Some fixes are already available here:
# http://www.spinics.net/lists/linux-ext4/msg27857.html
# http://www.spinics.net/lists/linux-ext4/msg28552.html
xfstests: add a new test that runs fsstress under ENOSPC conditions
# Following testcase may fail on recent kernel in case of ext3/4
# Fixes available here:
# http://patchwork.ozlabs.org/patch/120581/
# http://patchwork.ozlabs.org/patch/120582/
xfstests: add a new quota test that runs fsstress under ENOSPC conditions
P.S: ext4 still contains bugs caused by ordered_mode=>journal_mode
switch for didicated inode (chattr +j ./afile), so one can temproraly
disable jdata switch test by adding FSSTRESS_AVOID="-M 0xffffbfff"
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 0/8] xfstests: Bunch of new stress tests -v3
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
Changes from v2 ( in request to Christoph's comments)
- rearange patch sequance
- codestyle cleanups
- give better description
- add tunable mask for FS_IOC_SETFLAGS test.
LOG:
# Following patches improves fsstress logging
xfstests: fsstress dump inode info when possible
xfstests: add different logging option to fsstress
# Following patch makes fsstress more manageable
xfstests: fsstress should kill children tasks before exit
# Following patches add new tests
xfstests: add fallocate support to fsstress
xfstests: fsstress add FS_IOC_{SET,GET}FLAGS operations v2
xfstests: add fiemap operation to fsstress
# Following testcase may fail on recent kernel in case of ext4
# Some fixes are already available here:
# http://www.spinics.net/lists/linux-ext4/msg27857.html
# http://www.spinics.net/lists/linux-ext4/msg28552.html
xfstests: add a new test that runs fsstress under ENOSPC conditions
# Following testcase may fail on recent kernel in case of ext3/4
# Fixes available here:
# http://patchwork.ozlabs.org/patch/120581/
# http://patchwork.ozlabs.org/patch/120582/
xfstests: add a new quota test that runs fsstress under ENOSPC conditions
P.S: ext4 still contains bugs caused by ordered_mode=>journal_mode
switch for didicated inode (chattr +j ./afile), so one can temproraly
disable jdata switch test by adding FSSTRESS_AVOID="-M 0xffffbfff"
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 1/8] xfstests: fsstress dump inode info when possible
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
Fsstress exec behaviour is not completely determinated in case of
low resources mode due to ENOMEM, ENOSPC, etc. In some places we
call stat(2). This information may be halpfull for future
investigations purposes. Let's dump stat info where possible.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 83 +++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 55 insertions(+), 28 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index c37cddf..51ecda2 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -1391,6 +1391,14 @@ zero_freq(void)
p->freq = 0;
}
+void inode_info(char *str, size_t sz, struct stat64 *s, int verbose)
+{
+ if (verbose)
+ snprintf(str, sz, "[%ld %ld %d %d %lld %lld]", (long)s->st_ino,
+ (long)s->st_nlink, s->st_uid, s->st_gid,
+ (long long) s->st_blocks, (long long) s->st_size);
+}
+
void
allocsp_f(int opno, long r)
{
@@ -1402,6 +1410,7 @@ allocsp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1428,6 +1437,7 @@ allocsp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -1435,9 +1445,10 @@ allocsp_f(int opno, long r)
fl.l_start = off;
fl.l_len = 0;
e = xfsctl(f.path, fd, XFS_IOC_ALLOCSP64, &fl) < 0 ? errno : 0;
- if (v)
- printf("%d/%d: xfsctl(XFS_IOC_ALLOCSP64) %s %lld 0 %d\n",
- procid, opno, f.path, (long long)off, e);
+ if (v) {
+ printf("%d/%d: xfsctl(XFS_IOC_ALLOCSP64) %s%s %lld 0 %d\n",
+ procid, opno, f.path, st, (long long)off, e);
+ }
free_pathname(&f);
close(fd);
}
@@ -1779,6 +1790,7 @@ dread_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1800,15 +1812,16 @@ dread_f(int opno, long r)
if (fstat64(fd, &stb) < 0) {
if (v)
printf("%d/%d: dread - fstat64 %s failed %d\n",
- procid, opno, f.path, errno);
+ procid, opno, f.path, errno);
free_pathname(&f);
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
if (stb.st_size == 0) {
if (v)
- printf("%d/%d: dread - %s zero size\n", procid, opno,
- f.path);
+ printf("%d/%d: dread - %s%s zero size\n", procid, opno,
+ f.path, st);
free_pathname(&f);
close(fd);
return;
@@ -1816,8 +1829,8 @@ dread_f(int opno, long r)
if (xfsctl(f.path, fd, XFS_IOC_DIOINFO, &diob) < 0) {
if (v)
printf(
- "%d/%d: dread - xfsctl(XFS_IOC_DIOINFO) %s failed %d\n",
- procid, opno, f.path, errno);
+ "%d/%d: dread - xfsctl(XFS_IOC_DIOINFO) %s%s failed %d\n",
+ procid, opno, f.path, st, errno);
free_pathname(&f);
close(fd);
return;
@@ -1837,8 +1850,8 @@ dread_f(int opno, long r)
e = read(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: dread %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: dread %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
@@ -1857,6 +1870,7 @@ dwrite_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1883,11 +1897,12 @@ dwrite_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
if (xfsctl(f.path, fd, XFS_IOC_DIOINFO, &diob) < 0) {
if (v)
printf("%d/%d: dwrite - xfsctl(XFS_IOC_DIOINFO)"
- " %s failed %d\n",
- procid, opno, f.path, errno);
+ " %s%s failed %d\n",
+ procid, opno, f.path, st, errno);
free_pathname(&f);
close(fd);
return;
@@ -1910,8 +1925,8 @@ dwrite_f(int opno, long r)
e = write(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: dwrite %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: dwrite %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
@@ -1960,6 +1975,7 @@ freesp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1986,6 +2002,7 @@ freesp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -1994,8 +2011,8 @@ freesp_f(int opno, long r)
fl.l_len = 0;
e = xfsctl(f.path, fd, XFS_IOC_FREESP64, &fl) < 0 ? errno : 0;
if (v)
- printf("%d/%d: xfsctl(XFS_IOC_FREESP64) %s %lld 0 %d\n",
- procid, opno, f.path, (long long)off, e);
+ printf("%d/%d: xfsctl(XFS_IOC_FREESP64) %s%s %lld 0 %d\n",
+ procid, opno, f.path, st, (long long)off, e);
free_pathname(&f);
close(fd);
}
@@ -2198,6 +2215,7 @@ read_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2224,10 +2242,11 @@ read_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
if (stb.st_size == 0) {
if (v)
- printf("%d/%d: read - %s zero size\n", procid, opno,
- f.path);
+ printf("%d/%d: read - %s%s zero size\n", procid, opno,
+ f.path, st);
free_pathname(&f);
close(fd);
return;
@@ -2240,8 +2259,8 @@ read_f(int opno, long r)
e = read(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: read %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: read %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
@@ -2348,6 +2367,7 @@ resvsp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2374,6 +2394,7 @@ resvsp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -2382,8 +2403,8 @@ resvsp_f(int opno, long r)
fl.l_len = (off64_t)(random() % (1024 * 1024));
e = xfsctl(f.path, fd, XFS_IOC_RESVSP64, &fl) < 0 ? errno : 0;
if (v)
- printf("%d/%d: xfsctl(XFS_IOC_RESVSP64) %s %lld %lld %d\n",
- procid, opno, f.path,
+ printf("%d/%d: xfsctl(XFS_IOC_RESVSP64) %s%s %lld %lld %d\n",
+ procid, opno, f.path, st,
(long long)off, (long long)fl.l_len, e);
free_pathname(&f);
close(fd);
@@ -2506,6 +2527,7 @@ truncate_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2523,14 +2545,15 @@ truncate_f(int opno, long r)
free_pathname(&f);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
e = truncate64_path(&f, off) < 0 ? errno : 0;
check_cwd();
if (v)
- printf("%d/%d: truncate %s %lld %d\n", procid, opno, f.path,
- (long long)off, e);
+ printf("%d/%d: truncate %s%s %lld %d\n", procid, opno, f.path,
+ st, (long long)off, e);
free_pathname(&f);
}
@@ -2574,6 +2597,7 @@ unresvsp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2600,6 +2624,7 @@ unresvsp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -2608,8 +2633,8 @@ unresvsp_f(int opno, long r)
fl.l_len = (off64_t)(random() % (1 << 20));
e = xfsctl(f.path, fd, XFS_IOC_UNRESVSP64, &fl) < 0 ? errno : 0;
if (v)
- printf("%d/%d: xfsctl(XFS_IOC_UNRESVSP64) %s %lld %lld %d\n",
- procid, opno, f.path,
+ printf("%d/%d: xfsctl(XFS_IOC_UNRESVSP64) %s%s %lld %lld %d\n",
+ procid, opno, f.path, st,
(long long)off, (long long)fl.l_len, e);
free_pathname(&f);
close(fd);
@@ -2627,6 +2652,7 @@ write_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGm, r, &f, NULL, NULL, &v)) {
@@ -2653,6 +2679,7 @@ write_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -2663,8 +2690,8 @@ write_f(int opno, long r)
e = write(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: write %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: write %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 1/8] xfstests: fsstress dump inode info when possible
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
Fsstress exec behaviour is not completely determinated in case of
low resources mode due to ENOMEM, ENOSPC, etc. In some places we
call stat(2). This information may be halpfull for future
investigations purposes. Let's dump stat info where possible.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 83 +++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 55 insertions(+), 28 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index c37cddf..51ecda2 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -1391,6 +1391,14 @@ zero_freq(void)
p->freq = 0;
}
+void inode_info(char *str, size_t sz, struct stat64 *s, int verbose)
+{
+ if (verbose)
+ snprintf(str, sz, "[%ld %ld %d %d %lld %lld]", (long)s->st_ino,
+ (long)s->st_nlink, s->st_uid, s->st_gid,
+ (long long) s->st_blocks, (long long) s->st_size);
+}
+
void
allocsp_f(int opno, long r)
{
@@ -1402,6 +1410,7 @@ allocsp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1428,6 +1437,7 @@ allocsp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -1435,9 +1445,10 @@ allocsp_f(int opno, long r)
fl.l_start = off;
fl.l_len = 0;
e = xfsctl(f.path, fd, XFS_IOC_ALLOCSP64, &fl) < 0 ? errno : 0;
- if (v)
- printf("%d/%d: xfsctl(XFS_IOC_ALLOCSP64) %s %lld 0 %d\n",
- procid, opno, f.path, (long long)off, e);
+ if (v) {
+ printf("%d/%d: xfsctl(XFS_IOC_ALLOCSP64) %s%s %lld 0 %d\n",
+ procid, opno, f.path, st, (long long)off, e);
+ }
free_pathname(&f);
close(fd);
}
@@ -1779,6 +1790,7 @@ dread_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1800,15 +1812,16 @@ dread_f(int opno, long r)
if (fstat64(fd, &stb) < 0) {
if (v)
printf("%d/%d: dread - fstat64 %s failed %d\n",
- procid, opno, f.path, errno);
+ procid, opno, f.path, errno);
free_pathname(&f);
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
if (stb.st_size == 0) {
if (v)
- printf("%d/%d: dread - %s zero size\n", procid, opno,
- f.path);
+ printf("%d/%d: dread - %s%s zero size\n", procid, opno,
+ f.path, st);
free_pathname(&f);
close(fd);
return;
@@ -1816,8 +1829,8 @@ dread_f(int opno, long r)
if (xfsctl(f.path, fd, XFS_IOC_DIOINFO, &diob) < 0) {
if (v)
printf(
- "%d/%d: dread - xfsctl(XFS_IOC_DIOINFO) %s failed %d\n",
- procid, opno, f.path, errno);
+ "%d/%d: dread - xfsctl(XFS_IOC_DIOINFO) %s%s failed %d\n",
+ procid, opno, f.path, st, errno);
free_pathname(&f);
close(fd);
return;
@@ -1837,8 +1850,8 @@ dread_f(int opno, long r)
e = read(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: dread %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: dread %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
@@ -1857,6 +1870,7 @@ dwrite_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1883,11 +1897,12 @@ dwrite_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
if (xfsctl(f.path, fd, XFS_IOC_DIOINFO, &diob) < 0) {
if (v)
printf("%d/%d: dwrite - xfsctl(XFS_IOC_DIOINFO)"
- " %s failed %d\n",
- procid, opno, f.path, errno);
+ " %s%s failed %d\n",
+ procid, opno, f.path, st, errno);
free_pathname(&f);
close(fd);
return;
@@ -1910,8 +1925,8 @@ dwrite_f(int opno, long r)
e = write(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: dwrite %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: dwrite %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
@@ -1960,6 +1975,7 @@ freesp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -1986,6 +2002,7 @@ freesp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -1994,8 +2011,8 @@ freesp_f(int opno, long r)
fl.l_len = 0;
e = xfsctl(f.path, fd, XFS_IOC_FREESP64, &fl) < 0 ? errno : 0;
if (v)
- printf("%d/%d: xfsctl(XFS_IOC_FREESP64) %s %lld 0 %d\n",
- procid, opno, f.path, (long long)off, e);
+ printf("%d/%d: xfsctl(XFS_IOC_FREESP64) %s%s %lld 0 %d\n",
+ procid, opno, f.path, st, (long long)off, e);
free_pathname(&f);
close(fd);
}
@@ -2198,6 +2215,7 @@ read_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2224,10 +2242,11 @@ read_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
if (stb.st_size == 0) {
if (v)
- printf("%d/%d: read - %s zero size\n", procid, opno,
- f.path);
+ printf("%d/%d: read - %s%s zero size\n", procid, opno,
+ f.path, st);
free_pathname(&f);
close(fd);
return;
@@ -2240,8 +2259,8 @@ read_f(int opno, long r)
e = read(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: read %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: read %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
@@ -2348,6 +2367,7 @@ resvsp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2374,6 +2394,7 @@ resvsp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -2382,8 +2403,8 @@ resvsp_f(int opno, long r)
fl.l_len = (off64_t)(random() % (1024 * 1024));
e = xfsctl(f.path, fd, XFS_IOC_RESVSP64, &fl) < 0 ? errno : 0;
if (v)
- printf("%d/%d: xfsctl(XFS_IOC_RESVSP64) %s %lld %lld %d\n",
- procid, opno, f.path,
+ printf("%d/%d: xfsctl(XFS_IOC_RESVSP64) %s%s %lld %lld %d\n",
+ procid, opno, f.path, st,
(long long)off, (long long)fl.l_len, e);
free_pathname(&f);
close(fd);
@@ -2506,6 +2527,7 @@ truncate_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2523,14 +2545,15 @@ truncate_f(int opno, long r)
free_pathname(&f);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
e = truncate64_path(&f, off) < 0 ? errno : 0;
check_cwd();
if (v)
- printf("%d/%d: truncate %s %lld %d\n", procid, opno, f.path,
- (long long)off, e);
+ printf("%d/%d: truncate %s%s %lld %d\n", procid, opno, f.path,
+ st, (long long)off, e);
free_pathname(&f);
}
@@ -2574,6 +2597,7 @@ unresvsp_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
@@ -2600,6 +2624,7 @@ unresvsp_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -2608,8 +2633,8 @@ unresvsp_f(int opno, long r)
fl.l_len = (off64_t)(random() % (1 << 20));
e = xfsctl(f.path, fd, XFS_IOC_UNRESVSP64, &fl) < 0 ? errno : 0;
if (v)
- printf("%d/%d: xfsctl(XFS_IOC_UNRESVSP64) %s %lld %lld %d\n",
- procid, opno, f.path,
+ printf("%d/%d: xfsctl(XFS_IOC_UNRESVSP64) %s%s %lld %lld %d\n",
+ procid, opno, f.path, st,
(long long)off, (long long)fl.l_len, e);
free_pathname(&f);
close(fd);
@@ -2627,6 +2652,7 @@ write_f(int opno, long r)
off64_t off;
struct stat64 stb;
int v;
+ char st[1024];
init_pathname(&f);
if (!get_fname(FT_REGm, r, &f, NULL, NULL, &v)) {
@@ -2653,6 +2679,7 @@ write_f(int opno, long r)
close(fd);
return;
}
+ inode_info(st, sizeof(st), &stb, v);
lr = ((__int64_t)random() << 32) + random();
off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
off %= maxfsize;
@@ -2663,8 +2690,8 @@ write_f(int opno, long r)
e = write(fd, buf, len) < 0 ? errno : 0;
free(buf);
if (v)
- printf("%d/%d: write %s [%lld,%d] %d\n",
- procid, opno, f.path, (long long)off, (int)len, e);
+ printf("%d/%d: write %s%s [%lld,%d] %d\n",
+ procid, opno, f.path, st, (long long)off, (int)len, e);
free_pathname(&f);
close(fd);
}
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/8] xfstests: add different logging option to fsstress
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
Currently the only way to log fsstress's output is to redirect it's shared
stdout to pipe which is very painfull because:
1) Pipe writers are serialized via i_mutex so we waste cpu-cores power on stupid
sinchronization for loging purpose, instead of hunting real race conditions,
and bugs inside file system.
2) Usually output is corrupted due to luck of sychronization on shared stdout.
Since fsstress's children operate on independend paths, let's just open didicated
log file for each child and simply avoid useless sycnhronization.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 51ecda2..c7001f3 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -258,6 +258,8 @@ int main(int argc, char **argv)
char buf[10];
int c;
char *dirname = NULL;
+ char *logname = NULL;
+ char rpath[PATH_MAX];
int fd;
int i;
int j;
@@ -273,7 +275,7 @@ int main(int argc, char **argv)
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
- while ((c = getopt(argc, argv, "d:e:f:i:m:n:p:rs:vwzHS")) != -1) {
+ while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHS")) != -1) {
switch (c) {
case 'd':
dirname = optarg;
@@ -311,6 +313,10 @@ int main(int argc, char **argv)
case 'n':
operations = atoi(optarg);
break;
+ case 'o':
+ logname = optarg;
+ break;
+
case 'p':
nproc = atoi(optarg);
break;
@@ -351,10 +357,26 @@ int main(int argc, char **argv)
}
(void)mkdir(dirname, 0777);
+ if (logname && logname[0] != '/') {
+ if (getcwd(rpath, sizeof(rpath)) < 0){
+ perror("getcwd failed");
+ exit(1);
+ }
+ } else {
+ rpath[0] = '\0';
+ }
if (chdir(dirname) < 0) {
perror(dirname);
exit(1);
}
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s", rpath, logname);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
sprintf(buf, "fss%x", (unsigned int)getpid());
fd = creat(buf, 0666);
if (lseek64(fd, (off64_t)(MAXFSIZE32 + 1ULL), SEEK_SET) < 0)
@@ -409,6 +431,15 @@ int main(int argc, char **argv)
close(fd);
for (i = 0; i < nproc; i++) {
if (fork() == 0) {
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s.%d",
+ rpath, logname, i);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
procid = i;
doproc();
return 0;
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/8] xfstests: add different logging option to fsstress
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
Currently the only way to log fsstress's output is to redirect it's shared
stdout to pipe which is very painfull because:
1) Pipe writers are serialized via i_mutex so we waste cpu-cores power on stupid
sinchronization for loging purpose, instead of hunting real race conditions,
and bugs inside file system.
2) Usually output is corrupted due to luck of sychronization on shared stdout.
Since fsstress's children operate on independend paths, let's just open didicated
log file for each child and simply avoid useless sycnhronization.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 51ecda2..c7001f3 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -258,6 +258,8 @@ int main(int argc, char **argv)
char buf[10];
int c;
char *dirname = NULL;
+ char *logname = NULL;
+ char rpath[PATH_MAX];
int fd;
int i;
int j;
@@ -273,7 +275,7 @@ int main(int argc, char **argv)
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
- while ((c = getopt(argc, argv, "d:e:f:i:m:n:p:rs:vwzHS")) != -1) {
+ while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHS")) != -1) {
switch (c) {
case 'd':
dirname = optarg;
@@ -311,6 +313,10 @@ int main(int argc, char **argv)
case 'n':
operations = atoi(optarg);
break;
+ case 'o':
+ logname = optarg;
+ break;
+
case 'p':
nproc = atoi(optarg);
break;
@@ -351,10 +357,26 @@ int main(int argc, char **argv)
}
(void)mkdir(dirname, 0777);
+ if (logname && logname[0] != '/') {
+ if (getcwd(rpath, sizeof(rpath)) < 0){
+ perror("getcwd failed");
+ exit(1);
+ }
+ } else {
+ rpath[0] = '\0';
+ }
if (chdir(dirname) < 0) {
perror(dirname);
exit(1);
}
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s", rpath, logname);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
sprintf(buf, "fss%x", (unsigned int)getpid());
fd = creat(buf, 0666);
if (lseek64(fd, (off64_t)(MAXFSIZE32 + 1ULL), SEEK_SET) < 0)
@@ -409,6 +431,15 @@ int main(int argc, char **argv)
close(fd);
for (i = 0; i < nproc; i++) {
if (fork() == 0) {
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s.%d",
+ rpath, logname, i);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
procid = i;
doproc();
return 0;
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 3/8] xfstests: fsstress should kill children tasks before exit
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
It is very hard to predict runtime for fsstress. In many cases it
is useful to give test to run a reasonable time, and then kill it.
But currently there is no reliable way to kill test without leaving
running children.
This patch add sanity cleanup logic which looks follow:
- On sigterm received by parent, it resend signal to it's children
- Wait for each child to terminates
- EXTRA_SANITY: Even if parent was killed by other signal, children
will be terminated with SIGKILL to preven staled children.
So now one can simply run fsstress like this:
./fsstress -p 1000 -n999999999 -d $TEST_DIR &
PID=$!
sleep 300
kill $PID
wait $PID
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
aclocal.m4 | 5 +++++
configure.in | 1 +
ltp/fsstress.c | 37 ++++++++++++++++++++++++++++++++++++-
3 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 168eb59..5532606 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -16,6 +16,11 @@ AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
AC_SUBST(have_fiemap)
])
+AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
+ [ AC_CHECK_HEADERS([sys/prctl.h], [ have_prctl=true ], [ have_prctl=false ])
+ AC_SUBST(have_prctl)
+ ])
+
AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
[ AC_MSG_CHECKING([for fallocate])
AC_TRY_LINK([
diff --git a/configure.in b/configure.in
index c697b4f..76d23e4 100644
--- a/configure.in
+++ b/configure.in
@@ -67,6 +67,7 @@ in
AC_PACKAGE_WANT_DMAPI
AC_PACKAGE_WANT_LINUX_FIEMAP_H
AC_PACKAGE_WANT_FALLOCATE
+ AC_PACKAGE_WANT_LINUX_PRCTL_H
;;
esac
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index c7001f3..133a247 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -28,7 +28,9 @@
#ifndef HAVE_ATTR_LIST
#define attr_list(path, buf, size, flags, cursor) (errno = -ENOSYS, -1)
#endif
-
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
#include <math.h>
#define XFS_ERRTAG_MAX 17
#define XFS_IDMODULO_MAX 31 /* user/group IDs (1 << x) */
@@ -209,6 +211,7 @@ int rtpct;
unsigned long seed = 0;
ino_t top_ino;
int verbose = 0;
+sig_atomic_t should_stop = 0;
void add_to_flist(int, int, int);
void append_pathname(pathname_t *, char *);
@@ -253,6 +256,11 @@ void usage(void);
void write_freq(void);
void zero_freq(void);
+void sg_handler(int signum)
+{
+ should_stop = 1;
+}
+
int main(int argc, char **argv)
{
char buf[10];
@@ -269,6 +277,7 @@ int main(int argc, char **argv)
ptrdiff_t srval;
int nousage = 0;
xfs_error_injection_t err_inj;
+ struct sigaction action;
errrange = errtag = 0;
umask(0);
@@ -429,8 +438,27 @@ int main(int argc, char **argv)
}
} else
close(fd);
+
+ setpgid(0, 0);
+ action.sa_handler = sg_handler;
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = 0;
+ if (sigaction(SIGTERM, &action, 0)) {
+ perror("sigaction failed");
+ exit(1);
+ }
+
for (i = 0; i < nproc; i++) {
if (fork() == 0) {
+ action.sa_handler = SIG_DFL;
+ sigemptyset(&action.sa_mask);
+ if (sigaction(SIGTERM, &action, 0))
+ return 1;
+#ifdef HAVE_SYS_PRCTL_H
+ prctl(PR_SET_PDEATHSIG, SIGKILL);
+ if (getppid() == 1) /* parent died already? */
+ return 0;
+#endif
if (logname) {
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s/%s.%d",
@@ -445,8 +473,15 @@ int main(int argc, char **argv)
return 0;
}
}
+ while (wait(&stat) > 0 && !should_stop) {
+ continue;
+ }
+ action.sa_flags = SA_RESTART;
+ sigaction(SIGTERM, &action, 0);
+ kill(-getpid(), SIGTERM);
while (wait(&stat) > 0)
continue;
+
if (errtag != 0) {
err_inj.errtag = 0;
err_inj.fd = fd;
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 3/8] xfstests: fsstress should kill children tasks before exit
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
It is very hard to predict runtime for fsstress. In many cases it
is useful to give test to run a reasonable time, and then kill it.
But currently there is no reliable way to kill test without leaving
running children.
This patch add sanity cleanup logic which looks follow:
- On sigterm received by parent, it resend signal to it's children
- Wait for each child to terminates
- EXTRA_SANITY: Even if parent was killed by other signal, children
will be terminated with SIGKILL to preven staled children.
So now one can simply run fsstress like this:
./fsstress -p 1000 -n999999999 -d $TEST_DIR &
PID=$!
sleep 300
kill $PID
wait $PID
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
aclocal.m4 | 5 +++++
configure.in | 1 +
ltp/fsstress.c | 37 ++++++++++++++++++++++++++++++++++++-
3 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 168eb59..5532606 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -16,6 +16,11 @@ AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
AC_SUBST(have_fiemap)
])
+AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
+ [ AC_CHECK_HEADERS([sys/prctl.h], [ have_prctl=true ], [ have_prctl=false ])
+ AC_SUBST(have_prctl)
+ ])
+
AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
[ AC_MSG_CHECKING([for fallocate])
AC_TRY_LINK([
diff --git a/configure.in b/configure.in
index c697b4f..76d23e4 100644
--- a/configure.in
+++ b/configure.in
@@ -67,6 +67,7 @@ in
AC_PACKAGE_WANT_DMAPI
AC_PACKAGE_WANT_LINUX_FIEMAP_H
AC_PACKAGE_WANT_FALLOCATE
+ AC_PACKAGE_WANT_LINUX_PRCTL_H
;;
esac
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index c7001f3..133a247 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -28,7 +28,9 @@
#ifndef HAVE_ATTR_LIST
#define attr_list(path, buf, size, flags, cursor) (errno = -ENOSYS, -1)
#endif
-
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
#include <math.h>
#define XFS_ERRTAG_MAX 17
#define XFS_IDMODULO_MAX 31 /* user/group IDs (1 << x) */
@@ -209,6 +211,7 @@ int rtpct;
unsigned long seed = 0;
ino_t top_ino;
int verbose = 0;
+sig_atomic_t should_stop = 0;
void add_to_flist(int, int, int);
void append_pathname(pathname_t *, char *);
@@ -253,6 +256,11 @@ void usage(void);
void write_freq(void);
void zero_freq(void);
+void sg_handler(int signum)
+{
+ should_stop = 1;
+}
+
int main(int argc, char **argv)
{
char buf[10];
@@ -269,6 +277,7 @@ int main(int argc, char **argv)
ptrdiff_t srval;
int nousage = 0;
xfs_error_injection_t err_inj;
+ struct sigaction action;
errrange = errtag = 0;
umask(0);
@@ -429,8 +438,27 @@ int main(int argc, char **argv)
}
} else
close(fd);
+
+ setpgid(0, 0);
+ action.sa_handler = sg_handler;
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = 0;
+ if (sigaction(SIGTERM, &action, 0)) {
+ perror("sigaction failed");
+ exit(1);
+ }
+
for (i = 0; i < nproc; i++) {
if (fork() == 0) {
+ action.sa_handler = SIG_DFL;
+ sigemptyset(&action.sa_mask);
+ if (sigaction(SIGTERM, &action, 0))
+ return 1;
+#ifdef HAVE_SYS_PRCTL_H
+ prctl(PR_SET_PDEATHSIG, SIGKILL);
+ if (getppid() == 1) /* parent died already? */
+ return 0;
+#endif
if (logname) {
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s/%s.%d",
@@ -445,8 +473,15 @@ int main(int argc, char **argv)
return 0;
}
}
+ while (wait(&stat) > 0 && !should_stop) {
+ continue;
+ }
+ action.sa_flags = SA_RESTART;
+ sigaction(SIGTERM, &action, 0);
+ kill(-getpid(), SIGTERM);
while (wait(&stat) > 0)
continue;
+
if (errtag != 0) {
err_inj.errtag = 0;
err_inj.fd = fd;
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 4/8] xfstests: add fallocate support to fsstress
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
Add tests for fallocate(2) syscall
- fallocate: reserve the disk space
- punch: de-allocates the disk space
Since FALLOC_FL_PUNCH_HOLE is relatively new it's value defined
explicitly if not yet defined. Later we may clear that define.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 126 insertions(+), 1 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 133a247..547bf30 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -24,7 +24,13 @@
#ifdef HAVE_ATTR_ATTRIBUTES_H
#include <attr/attributes.h>
#endif
-
+#ifdef FALLOCATE
+#include <linux/falloc.h>
+#ifndef FALLOC_FL_PUNCH_HOLE
+/* Copy-paste from linux/falloc.h */
+#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
+#endif
+#endif
#ifndef HAVE_ATTR_LIST
#define attr_list(path, buf, size, flags, cursor) (errno = -ENOSYS, -1)
#endif
@@ -48,6 +54,7 @@ typedef enum {
OP_CREAT,
OP_DREAD,
OP_DWRITE,
+ OP_FALLOCATE,
OP_FDATASYNC,
OP_FREESP,
OP_FSYNC,
@@ -55,6 +62,7 @@ typedef enum {
OP_LINK,
OP_MKDIR,
OP_MKNOD,
+ OP_PUNCH,
OP_READ,
OP_READLINK,
OP_RENAME,
@@ -128,6 +136,7 @@ void chown_f(int, long);
void creat_f(int, long);
void dread_f(int, long);
void dwrite_f(int, long);
+void fallocate_f(int, long);
void fdatasync_f(int, long);
void freesp_f(int, long);
void fsync_f(int, long);
@@ -135,6 +144,7 @@ void getdents_f(int, long);
void link_f(int, long);
void mkdir_f(int, long);
void mknod_f(int, long);
+void punch_f(int, long);
void read_f(int, long);
void readlink_f(int, long);
void rename_f(int, long);
@@ -159,6 +169,7 @@ opdesc_t ops[] = {
{ OP_CREAT, "creat", creat_f, 4, 1 },
{ OP_DREAD, "dread", dread_f, 4, 0 },
{ OP_DWRITE, "dwrite", dwrite_f, 4, 1 },
+ { OP_FALLOCATE, "fallocate", fallocate_f, 1, 1 },
{ OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1 },
{ OP_FREESP, "freesp", freesp_f, 1, 1 },
{ OP_FSYNC, "fsync", fsync_f, 1, 1 },
@@ -166,6 +177,7 @@ opdesc_t ops[] = {
{ OP_LINK, "link", link_f, 1, 1 },
{ OP_MKDIR, "mkdir", mkdir_f, 2, 1 },
{ OP_MKNOD, "mknod", mknod_f, 2, 1 },
+ { OP_PUNCH, "punch", punch_f, 1, 1 },
{ OP_READ, "read", read_f, 1, 0 },
{ OP_READLINK, "readlink", readlink_f, 1, 0 },
{ OP_RENAME, "rename", rename_f, 2, 1 },
@@ -1998,6 +2010,63 @@ dwrite_f(int opno, long r)
}
void
+fallocate_f(int opno, long r)
+{
+#ifdef FALLOCATE
+ int e;
+ pathname_t f;
+ int fd;
+ __int64_t lr;
+ off64_t off;
+ off64_t len;
+ struct stat64 stb;
+ int v;
+ char st[1024];
+ int mode = 0;
+
+ init_pathname(&f);
+ if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+ if (v)
+ printf("%d/%d: fallocate - no filename\n", procid, opno);
+ free_pathname(&f);
+ return;
+ }
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+ if (fd < 0) {
+ if (v)
+ printf("%d/%d: fallocate - open %s failed %d\n",
+ procid, opno, f.path, e);
+ free_pathname(&f);
+ return;
+ }
+ if (fstat64(fd, &stb) < 0) {
+ if (v)
+ printf("%d/%d: fallocate - fstat64 %s failed %d\n",
+ procid, opno, f.path, errno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ inode_info(st, sizeof(st), &stb, v);
+ lr = ((__int64_t)random() << 32) + random();
+ off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ len = (off64_t)(random() % (1024 * 1024));
+ mode |= FALLOC_FL_KEEP_SIZE & random();
+ e = fallocate(fd, mode, (loff_t)off, (loff_t)len) < 0 ? errno : 0;
+ if (v)
+ printf("%d/%d: fallocate(%d) %s %st %lld %lld %d\n",
+ procid, opno, mode,
+ f.path, st, (long long)off, (long long)len, e);
+ free_pathname(&f);
+ close(fd);
+#endif
+}
+
+
+void
fdatasync_f(int opno, long r)
{
int e;
@@ -2270,6 +2339,62 @@ mknod_f(int opno, long r)
}
void
+punch_f(int opno, long r)
+{
+#ifdef FALLOCATE
+ int e;
+ pathname_t f;
+ int fd;
+ __int64_t lr;
+ off64_t off;
+ off64_t len;
+ struct stat64 stb;
+ int v;
+ char st[1024];
+ int mode = FALLOC_FL_PUNCH_HOLE;
+
+ init_pathname(&f);
+ if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+ if (v)
+ printf("%d/%d: punch hole - no filename\n", procid, opno);
+ free_pathname(&f);
+ return;
+ }
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+ if (fd < 0) {
+ if (v)
+ printf("%d/%d: punch hole - open %s failed %d\n",
+ procid, opno, f.path, e);
+ free_pathname(&f);
+ return;
+ }
+ if (fstat64(fd, &stb) < 0) {
+ if (v)
+ printf("%d/%d: punch hole - fstat64 %s failed %d\n",
+ procid, opno, f.path, errno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ inode_info(st, sizeof(st), &stb, v);
+ lr = ((__int64_t)random() << 32) + random();
+ off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ len = (off64_t)(random() % (1024 * 1024));
+ mode |= FALLOC_FL_KEEP_SIZE & random();
+ e = fallocate(fd, mode, (loff_t)off, (loff_t)len) < 0 ? errno : 0;
+ if (v)
+ printf("%d/%d: punch hole(%d) %s %s %lld %lld %d\n",
+ procid, opno, mode,
+ f.path, st, (long long)off, (long long)len, e);
+ free_pathname(&f);
+ close(fd);
+#endif
+}
+
+void
read_f(int opno, long r)
{
char *buf;
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 4/8] xfstests: add fallocate support to fsstress
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
Add tests for fallocate(2) syscall
- fallocate: reserve the disk space
- punch: de-allocates the disk space
Since FALLOC_FL_PUNCH_HOLE is relatively new it's value defined
explicitly if not yet defined. Later we may clear that define.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 126 insertions(+), 1 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 133a247..547bf30 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -24,7 +24,13 @@
#ifdef HAVE_ATTR_ATTRIBUTES_H
#include <attr/attributes.h>
#endif
-
+#ifdef FALLOCATE
+#include <linux/falloc.h>
+#ifndef FALLOC_FL_PUNCH_HOLE
+/* Copy-paste from linux/falloc.h */
+#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
+#endif
+#endif
#ifndef HAVE_ATTR_LIST
#define attr_list(path, buf, size, flags, cursor) (errno = -ENOSYS, -1)
#endif
@@ -48,6 +54,7 @@ typedef enum {
OP_CREAT,
OP_DREAD,
OP_DWRITE,
+ OP_FALLOCATE,
OP_FDATASYNC,
OP_FREESP,
OP_FSYNC,
@@ -55,6 +62,7 @@ typedef enum {
OP_LINK,
OP_MKDIR,
OP_MKNOD,
+ OP_PUNCH,
OP_READ,
OP_READLINK,
OP_RENAME,
@@ -128,6 +136,7 @@ void chown_f(int, long);
void creat_f(int, long);
void dread_f(int, long);
void dwrite_f(int, long);
+void fallocate_f(int, long);
void fdatasync_f(int, long);
void freesp_f(int, long);
void fsync_f(int, long);
@@ -135,6 +144,7 @@ void getdents_f(int, long);
void link_f(int, long);
void mkdir_f(int, long);
void mknod_f(int, long);
+void punch_f(int, long);
void read_f(int, long);
void readlink_f(int, long);
void rename_f(int, long);
@@ -159,6 +169,7 @@ opdesc_t ops[] = {
{ OP_CREAT, "creat", creat_f, 4, 1 },
{ OP_DREAD, "dread", dread_f, 4, 0 },
{ OP_DWRITE, "dwrite", dwrite_f, 4, 1 },
+ { OP_FALLOCATE, "fallocate", fallocate_f, 1, 1 },
{ OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1 },
{ OP_FREESP, "freesp", freesp_f, 1, 1 },
{ OP_FSYNC, "fsync", fsync_f, 1, 1 },
@@ -166,6 +177,7 @@ opdesc_t ops[] = {
{ OP_LINK, "link", link_f, 1, 1 },
{ OP_MKDIR, "mkdir", mkdir_f, 2, 1 },
{ OP_MKNOD, "mknod", mknod_f, 2, 1 },
+ { OP_PUNCH, "punch", punch_f, 1, 1 },
{ OP_READ, "read", read_f, 1, 0 },
{ OP_READLINK, "readlink", readlink_f, 1, 0 },
{ OP_RENAME, "rename", rename_f, 2, 1 },
@@ -1998,6 +2010,63 @@ dwrite_f(int opno, long r)
}
void
+fallocate_f(int opno, long r)
+{
+#ifdef FALLOCATE
+ int e;
+ pathname_t f;
+ int fd;
+ __int64_t lr;
+ off64_t off;
+ off64_t len;
+ struct stat64 stb;
+ int v;
+ char st[1024];
+ int mode = 0;
+
+ init_pathname(&f);
+ if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+ if (v)
+ printf("%d/%d: fallocate - no filename\n", procid, opno);
+ free_pathname(&f);
+ return;
+ }
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+ if (fd < 0) {
+ if (v)
+ printf("%d/%d: fallocate - open %s failed %d\n",
+ procid, opno, f.path, e);
+ free_pathname(&f);
+ return;
+ }
+ if (fstat64(fd, &stb) < 0) {
+ if (v)
+ printf("%d/%d: fallocate - fstat64 %s failed %d\n",
+ procid, opno, f.path, errno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ inode_info(st, sizeof(st), &stb, v);
+ lr = ((__int64_t)random() << 32) + random();
+ off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ len = (off64_t)(random() % (1024 * 1024));
+ mode |= FALLOC_FL_KEEP_SIZE & random();
+ e = fallocate(fd, mode, (loff_t)off, (loff_t)len) < 0 ? errno : 0;
+ if (v)
+ printf("%d/%d: fallocate(%d) %s %st %lld %lld %d\n",
+ procid, opno, mode,
+ f.path, st, (long long)off, (long long)len, e);
+ free_pathname(&f);
+ close(fd);
+#endif
+}
+
+
+void
fdatasync_f(int opno, long r)
{
int e;
@@ -2270,6 +2339,62 @@ mknod_f(int opno, long r)
}
void
+punch_f(int opno, long r)
+{
+#ifdef FALLOCATE
+ int e;
+ pathname_t f;
+ int fd;
+ __int64_t lr;
+ off64_t off;
+ off64_t len;
+ struct stat64 stb;
+ int v;
+ char st[1024];
+ int mode = FALLOC_FL_PUNCH_HOLE;
+
+ init_pathname(&f);
+ if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+ if (v)
+ printf("%d/%d: punch hole - no filename\n", procid, opno);
+ free_pathname(&f);
+ return;
+ }
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+ if (fd < 0) {
+ if (v)
+ printf("%d/%d: punch hole - open %s failed %d\n",
+ procid, opno, f.path, e);
+ free_pathname(&f);
+ return;
+ }
+ if (fstat64(fd, &stb) < 0) {
+ if (v)
+ printf("%d/%d: punch hole - fstat64 %s failed %d\n",
+ procid, opno, f.path, errno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ inode_info(st, sizeof(st), &stb, v);
+ lr = ((__int64_t)random() << 32) + random();
+ off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ len = (off64_t)(random() % (1024 * 1024));
+ mode |= FALLOC_FL_KEEP_SIZE & random();
+ e = fallocate(fd, mode, (loff_t)off, (loff_t)len) < 0 ? errno : 0;
+ if (v)
+ printf("%d/%d: punch hole(%d) %s %s %lld %lld %d\n",
+ procid, opno, mode,
+ f.path, st, (long long)off, (long long)len, e);
+ free_pathname(&f);
+ close(fd);
+#endif
+}
+
+void
read_f(int opno, long r)
{
char *buf;
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 5/8] xfstests: fsstress add FS_IOC_{SET,GET}FLAGS operations v2
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
Add two new operations:
- getattr: ioctl(fd, FS_IOC_GETFLAGS, &fl)
- setattr: ioctl(fd, FS_IOC_SETFLAGS, &random_flags)
Attribute mask may be passed via -M opt, by default is (~0).
By default FS_IOC_SETFLAGS has zero probability because
it may produce inodes with APPEND or IMMUTABLE flags which
are not deletable by default. Let's assumes that one who
enable it knows how to delete such inodes.
For example like follows:
find $TEST_PATH -exec chattr -i -a {} \;
rm -rf $TEST_PATH
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
aclocal.m4 | 4 +++
configure.in | 1 +
ltp/fsstress.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 72 insertions(+), 1 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 5532606..5739004 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -21,6 +21,10 @@ AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
AC_SUBST(have_prctl)
])
+AC_DEFUN([AC_PACKAGE_WANT_LINUX_FS_H],
+ [ AC_CHECK_HEADER([linux/fs.h])
+ ])
+
AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
[ AC_MSG_CHECKING([for fallocate])
AC_TRY_LINK([
diff --git a/configure.in b/configure.in
index 76d23e4..3b40e55 100644
--- a/configure.in
+++ b/configure.in
@@ -68,6 +68,7 @@ in
AC_PACKAGE_WANT_LINUX_FIEMAP_H
AC_PACKAGE_WANT_FALLOCATE
AC_PACKAGE_WANT_LINUX_PRCTL_H
+ AC_PACKAGE_WANT_LINUX_FS_H
;;
esac
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 547bf30..9de59b6 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -37,6 +37,15 @@
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
+
+#include <linux/fs.h>
+#ifndef FS_IOC_GETFLAGS
+#define FS_IOC_GETFLAGS _IOR('f', 1, long)
+#endif
+#ifndef FS_IOC_SETFLAGS
+#define FS_IOC_SETFLAGS _IOW('f', 2, long)
+#endif
+
#include <math.h>
#define XFS_ERRTAG_MAX 17
#define XFS_IDMODULO_MAX 31 /* user/group IDs (1 << x) */
@@ -58,6 +67,7 @@ typedef enum {
OP_FDATASYNC,
OP_FREESP,
OP_FSYNC,
+ OP_GETATTR,
OP_GETDENTS,
OP_LINK,
OP_MKDIR,
@@ -68,6 +78,7 @@ typedef enum {
OP_RENAME,
OP_RESVSP,
OP_RMDIR,
+ OP_SETATTR,
OP_SETXATTR,
OP_STAT,
OP_SYMLINK,
@@ -140,6 +151,7 @@ void fallocate_f(int, long);
void fdatasync_f(int, long);
void freesp_f(int, long);
void fsync_f(int, long);
+void getattr_f(int, long);
void getdents_f(int, long);
void link_f(int, long);
void mkdir_f(int, long);
@@ -150,6 +162,7 @@ void readlink_f(int, long);
void rename_f(int, long);
void resvsp_f(int, long);
void rmdir_f(int, long);
+void setattr_f(int, long);
void setxattr_f(int, long);
void stat_f(int, long);
void symlink_f(int, long);
@@ -173,6 +186,7 @@ opdesc_t ops[] = {
{ OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1 },
{ OP_FREESP, "freesp", freesp_f, 1, 1 },
{ OP_FSYNC, "fsync", fsync_f, 1, 1 },
+ { OP_GETATTR, "getattr", getattr_f, 1, 0 },
{ OP_GETDENTS, "getdents", getdents_f, 1, 0 },
{ OP_LINK, "link", link_f, 1, 1 },
{ OP_MKDIR, "mkdir", mkdir_f, 2, 1 },
@@ -183,6 +197,7 @@ opdesc_t ops[] = {
{ OP_RENAME, "rename", rename_f, 2, 1 },
{ OP_RESVSP, "resvsp", resvsp_f, 1, 1 },
{ OP_RMDIR, "rmdir", rmdir_f, 1, 1 },
+ { OP_SETATTR, "setattr", setattr_f, 0, 1 },
{ OP_SETXATTR, "setxattr", setxattr_f, 1, 1 },
{ OP_STAT, "stat", stat_f, 1, 0 },
{ OP_SYMLINK, "symlink", symlink_f, 2, 1 },
@@ -218,6 +233,7 @@ int nops;
int nproc = 1;
int operations = 1;
unsigned int idmodulo = XFS_IDMODULO_MAX;
+unsigned int attr_mask = ~0;
int procid;
int rtpct;
unsigned long seed = 0;
@@ -296,7 +312,7 @@ int main(int argc, char **argv)
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
- while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHS")) != -1) {
+ while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHM:S")) != -1) {
switch (c) {
case 'd':
dirname = optarg;
@@ -356,6 +372,9 @@ int main(int argc, char **argv)
case 'z':
zero_freq();
break;
+ case 'M':
+ attr_mask = strtoul(optarg, NULL, 0);
+ break;
case 'S':
show_ops(0, NULL);
printf("\n");
@@ -2185,6 +2204,29 @@ fsync_f(int opno, long r)
}
void
+getattr_f(int opno, long r)
+{
+ int fd;
+ int e;
+ pathname_t f;
+ uint fl;
+ int v;
+
+ init_pathname(&f);
+ if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+ append_pathname(&f, ".");
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+
+ e = ioctl(fd, FS_IOC_GETFLAGS, &fl);
+ if (v)
+ printf("%d/%d: getattr %s %u %d\n", procid, opno, f.path, fl, e);
+ free_pathname(&f);
+ close(fd);
+}
+
+void
getdents_f(int opno, long r)
{
DIR *dir;
@@ -2630,6 +2672,30 @@ rmdir_f(int opno, long r)
}
void
+setattr_f(int opno, long r)
+{
+ int fd;
+ int e;
+ pathname_t f;
+ uint fl;
+ int v;
+
+ init_pathname(&f);
+ if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+ append_pathname(&f, ".");
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+
+ fl = attr_mask & (uint)random();
+ e = ioctl(fd, FS_IOC_SETFLAGS, &fl);
+ if (v)
+ printf("%d/%d: setattr %s %x %d\n", procid, opno, f.path, fl, e);
+ free_pathname(&f);
+ close(fd);
+}
+
+void
stat_f(int opno, long r)
{
int e;
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 5/8] xfstests: fsstress add FS_IOC_{SET, GET}FLAGS operations v2
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
Add two new operations:
- getattr: ioctl(fd, FS_IOC_GETFLAGS, &fl)
- setattr: ioctl(fd, FS_IOC_SETFLAGS, &random_flags)
Attribute mask may be passed via -M opt, by default is (~0).
By default FS_IOC_SETFLAGS has zero probability because
it may produce inodes with APPEND or IMMUTABLE flags which
are not deletable by default. Let's assumes that one who
enable it knows how to delete such inodes.
For example like follows:
find $TEST_PATH -exec chattr -i -a {} \;
rm -rf $TEST_PATH
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
aclocal.m4 | 4 +++
configure.in | 1 +
ltp/fsstress.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 72 insertions(+), 1 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 5532606..5739004 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -21,6 +21,10 @@ AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
AC_SUBST(have_prctl)
])
+AC_DEFUN([AC_PACKAGE_WANT_LINUX_FS_H],
+ [ AC_CHECK_HEADER([linux/fs.h])
+ ])
+
AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
[ AC_MSG_CHECKING([for fallocate])
AC_TRY_LINK([
diff --git a/configure.in b/configure.in
index 76d23e4..3b40e55 100644
--- a/configure.in
+++ b/configure.in
@@ -68,6 +68,7 @@ in
AC_PACKAGE_WANT_LINUX_FIEMAP_H
AC_PACKAGE_WANT_FALLOCATE
AC_PACKAGE_WANT_LINUX_PRCTL_H
+ AC_PACKAGE_WANT_LINUX_FS_H
;;
esac
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 547bf30..9de59b6 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -37,6 +37,15 @@
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
+
+#include <linux/fs.h>
+#ifndef FS_IOC_GETFLAGS
+#define FS_IOC_GETFLAGS _IOR('f', 1, long)
+#endif
+#ifndef FS_IOC_SETFLAGS
+#define FS_IOC_SETFLAGS _IOW('f', 2, long)
+#endif
+
#include <math.h>
#define XFS_ERRTAG_MAX 17
#define XFS_IDMODULO_MAX 31 /* user/group IDs (1 << x) */
@@ -58,6 +67,7 @@ typedef enum {
OP_FDATASYNC,
OP_FREESP,
OP_FSYNC,
+ OP_GETATTR,
OP_GETDENTS,
OP_LINK,
OP_MKDIR,
@@ -68,6 +78,7 @@ typedef enum {
OP_RENAME,
OP_RESVSP,
OP_RMDIR,
+ OP_SETATTR,
OP_SETXATTR,
OP_STAT,
OP_SYMLINK,
@@ -140,6 +151,7 @@ void fallocate_f(int, long);
void fdatasync_f(int, long);
void freesp_f(int, long);
void fsync_f(int, long);
+void getattr_f(int, long);
void getdents_f(int, long);
void link_f(int, long);
void mkdir_f(int, long);
@@ -150,6 +162,7 @@ void readlink_f(int, long);
void rename_f(int, long);
void resvsp_f(int, long);
void rmdir_f(int, long);
+void setattr_f(int, long);
void setxattr_f(int, long);
void stat_f(int, long);
void symlink_f(int, long);
@@ -173,6 +186,7 @@ opdesc_t ops[] = {
{ OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1 },
{ OP_FREESP, "freesp", freesp_f, 1, 1 },
{ OP_FSYNC, "fsync", fsync_f, 1, 1 },
+ { OP_GETATTR, "getattr", getattr_f, 1, 0 },
{ OP_GETDENTS, "getdents", getdents_f, 1, 0 },
{ OP_LINK, "link", link_f, 1, 1 },
{ OP_MKDIR, "mkdir", mkdir_f, 2, 1 },
@@ -183,6 +197,7 @@ opdesc_t ops[] = {
{ OP_RENAME, "rename", rename_f, 2, 1 },
{ OP_RESVSP, "resvsp", resvsp_f, 1, 1 },
{ OP_RMDIR, "rmdir", rmdir_f, 1, 1 },
+ { OP_SETATTR, "setattr", setattr_f, 0, 1 },
{ OP_SETXATTR, "setxattr", setxattr_f, 1, 1 },
{ OP_STAT, "stat", stat_f, 1, 0 },
{ OP_SYMLINK, "symlink", symlink_f, 2, 1 },
@@ -218,6 +233,7 @@ int nops;
int nproc = 1;
int operations = 1;
unsigned int idmodulo = XFS_IDMODULO_MAX;
+unsigned int attr_mask = ~0;
int procid;
int rtpct;
unsigned long seed = 0;
@@ -296,7 +312,7 @@ int main(int argc, char **argv)
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
- while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHS")) != -1) {
+ while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHM:S")) != -1) {
switch (c) {
case 'd':
dirname = optarg;
@@ -356,6 +372,9 @@ int main(int argc, char **argv)
case 'z':
zero_freq();
break;
+ case 'M':
+ attr_mask = strtoul(optarg, NULL, 0);
+ break;
case 'S':
show_ops(0, NULL);
printf("\n");
@@ -2185,6 +2204,29 @@ fsync_f(int opno, long r)
}
void
+getattr_f(int opno, long r)
+{
+ int fd;
+ int e;
+ pathname_t f;
+ uint fl;
+ int v;
+
+ init_pathname(&f);
+ if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+ append_pathname(&f, ".");
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+
+ e = ioctl(fd, FS_IOC_GETFLAGS, &fl);
+ if (v)
+ printf("%d/%d: getattr %s %u %d\n", procid, opno, f.path, fl, e);
+ free_pathname(&f);
+ close(fd);
+}
+
+void
getdents_f(int opno, long r)
{
DIR *dir;
@@ -2630,6 +2672,30 @@ rmdir_f(int opno, long r)
}
void
+setattr_f(int opno, long r)
+{
+ int fd;
+ int e;
+ pathname_t f;
+ uint fl;
+ int v;
+
+ init_pathname(&f);
+ if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+ append_pathname(&f, ".");
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+
+ fl = attr_mask & (uint)random();
+ e = ioctl(fd, FS_IOC_SETFLAGS, &fl);
+ if (v)
+ printf("%d/%d: setattr %s %x %d\n", procid, opno, f.path, fl, e);
+ free_pathname(&f);
+ close(fd);
+}
+
+void
stat_f(int opno, long r)
{
int e;
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
Related bug: http://patchwork.ozlabs.org/patch/118863
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 76 insertions(+), 0 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 9de59b6..759f7b3 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -24,6 +24,9 @@
#ifdef HAVE_ATTR_ATTRIBUTES_H
#include <attr/attributes.h>
#endif
+#ifdef HAVE_LINUX_FIEMAP_H
+#include <linux/fiemap.h>
+#endif
#ifdef FALLOCATE
#include <linux/falloc.h>
#ifndef FALLOC_FL_PUNCH_HOLE
@@ -65,6 +68,7 @@ typedef enum {
OP_DWRITE,
OP_FALLOCATE,
OP_FDATASYNC,
+ OP_FIEMAP,
OP_FREESP,
OP_FSYNC,
OP_GETATTR,
@@ -149,6 +153,7 @@ void dread_f(int, long);
void dwrite_f(int, long);
void fallocate_f(int, long);
void fdatasync_f(int, long);
+void fiemap_f(int, long);
void freesp_f(int, long);
void fsync_f(int, long);
void getattr_f(int, long);
@@ -184,6 +189,7 @@ opdesc_t ops[] = {
{ OP_DWRITE, "dwrite", dwrite_f, 4, 1 },
{ OP_FALLOCATE, "fallocate", fallocate_f, 1, 1 },
{ OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1 },
+ { OP_FIEMAP, "fiemap", fiemap_f, 1, 1 },
{ OP_FREESP, "freesp", freesp_f, 1, 1 },
{ OP_FSYNC, "fsync", fsync_f, 1, 1 },
{ OP_GETATTR, "getattr", getattr_f, 1, 0 },
@@ -2117,6 +2123,76 @@ fdatasync_f(int opno, long r)
free_pathname(&f);
close(fd);
}
+void
+fiemap_f(int opno, long r)
+{
+#ifdef HAVE_LINUX_FIEMAP_H
+ int e;
+ pathname_t f;
+ int fd;
+ __int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+ char st[1024];
+ int blocks_to_map;
+ struct fiemap *fiemap;
+
+ init_pathname(&f);
+ if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+ if (v)
+ printf("%d/%d: fiemap - no filename\n", procid, opno);
+ free_pathname(&f);
+ return;
+ }
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+ if (fd < 0) {
+ if (v)
+ printf("%d/%d: fiemap - open %s failed %d\n",
+ procid, opno, f.path, e);
+ free_pathname(&f);
+ return;
+ }
+ if (fstat64(fd, &stb) < 0) {
+ if (v)
+ printf("%d/%d: fiemap - fstat64 %s failed %d\n",
+ procid, opno, f.path, errno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ inode_info(st, sizeof(st), &stb, v);
+ blocks_to_map = random() & 0xffff;
+ fiemap = (struct fiemap *)malloc(sizeof(struct fiemap) +
+ (blocks_to_map * sizeof(struct fiemap_extent)));
+ if (!fiemap) {
+ if (v)
+ printf("%d/%d: malloc failed \n", procid, opno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ lr = ((__int64_t)random() << 32) + random();
+ off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fiemap->fm_flags = random() & (FIEMAP_FLAGS_COMPAT | 0x10000);
+ fiemap->fm_extent_count = blocks_to_map;
+ fiemap->fm_mapped_extents = random() & 0xffff;
+ fiemap->fm_start = off;
+ fiemap->fm_length = ((__int64_t)random() << 32) + random();
+
+ e = ioctl(fd, FS_IOC_FIEMAP, (unsigned long)fiemap);
+ if (v)
+ printf("%d/%d: ioctl(FIEMAP) %s%s %lld %lld %x %d\n",
+ procid, opno, f.path, st, (long long)fiemap->fm_start,
+ (long long) fiemap->fm_length, fiemap->fm_flags, e);
+ free(fiemap);
+ free_pathname(&f);
+ close(fd);
+#endif
+}
void
freesp_f(int opno, long r)
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
Related bug: http://patchwork.ozlabs.org/patch/118863
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 76 insertions(+), 0 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 9de59b6..759f7b3 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -24,6 +24,9 @@
#ifdef HAVE_ATTR_ATTRIBUTES_H
#include <attr/attributes.h>
#endif
+#ifdef HAVE_LINUX_FIEMAP_H
+#include <linux/fiemap.h>
+#endif
#ifdef FALLOCATE
#include <linux/falloc.h>
#ifndef FALLOC_FL_PUNCH_HOLE
@@ -65,6 +68,7 @@ typedef enum {
OP_DWRITE,
OP_FALLOCATE,
OP_FDATASYNC,
+ OP_FIEMAP,
OP_FREESP,
OP_FSYNC,
OP_GETATTR,
@@ -149,6 +153,7 @@ void dread_f(int, long);
void dwrite_f(int, long);
void fallocate_f(int, long);
void fdatasync_f(int, long);
+void fiemap_f(int, long);
void freesp_f(int, long);
void fsync_f(int, long);
void getattr_f(int, long);
@@ -184,6 +189,7 @@ opdesc_t ops[] = {
{ OP_DWRITE, "dwrite", dwrite_f, 4, 1 },
{ OP_FALLOCATE, "fallocate", fallocate_f, 1, 1 },
{ OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1 },
+ { OP_FIEMAP, "fiemap", fiemap_f, 1, 1 },
{ OP_FREESP, "freesp", freesp_f, 1, 1 },
{ OP_FSYNC, "fsync", fsync_f, 1, 1 },
{ OP_GETATTR, "getattr", getattr_f, 1, 0 },
@@ -2117,6 +2123,76 @@ fdatasync_f(int opno, long r)
free_pathname(&f);
close(fd);
}
+void
+fiemap_f(int opno, long r)
+{
+#ifdef HAVE_LINUX_FIEMAP_H
+ int e;
+ pathname_t f;
+ int fd;
+ __int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+ char st[1024];
+ int blocks_to_map;
+ struct fiemap *fiemap;
+
+ init_pathname(&f);
+ if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+ if (v)
+ printf("%d/%d: fiemap - no filename\n", procid, opno);
+ free_pathname(&f);
+ return;
+ }
+ fd = open_path(&f, O_RDWR);
+ e = fd < 0 ? errno : 0;
+ check_cwd();
+ if (fd < 0) {
+ if (v)
+ printf("%d/%d: fiemap - open %s failed %d\n",
+ procid, opno, f.path, e);
+ free_pathname(&f);
+ return;
+ }
+ if (fstat64(fd, &stb) < 0) {
+ if (v)
+ printf("%d/%d: fiemap - fstat64 %s failed %d\n",
+ procid, opno, f.path, errno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ inode_info(st, sizeof(st), &stb, v);
+ blocks_to_map = random() & 0xffff;
+ fiemap = (struct fiemap *)malloc(sizeof(struct fiemap) +
+ (blocks_to_map * sizeof(struct fiemap_extent)));
+ if (!fiemap) {
+ if (v)
+ printf("%d/%d: malloc failed \n", procid, opno);
+ free_pathname(&f);
+ close(fd);
+ return;
+ }
+ lr = ((__int64_t)random() << 32) + random();
+ off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fiemap->fm_flags = random() & (FIEMAP_FLAGS_COMPAT | 0x10000);
+ fiemap->fm_extent_count = blocks_to_map;
+ fiemap->fm_mapped_extents = random() & 0xffff;
+ fiemap->fm_start = off;
+ fiemap->fm_length = ((__int64_t)random() << 32) + random();
+
+ e = ioctl(fd, FS_IOC_FIEMAP, (unsigned long)fiemap);
+ if (v)
+ printf("%d/%d: ioctl(FIEMAP) %s%s %lld %lld %x %d\n",
+ procid, opno, f.path, st, (long long)fiemap->fm_start,
+ (long long) fiemap->fm_length, fiemap->fm_flags, e);
+ free(fiemap);
+ free_pathname(&f);
+ close(fd);
+#endif
+}
void
freesp_f(int opno, long r)
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
During stress testing we want to cover as much code paths as possible
fsstress is very good for this purpose. But it has expandable nature
(disk usage almost continually grow). So once it goes in no ENOSPC
condition it will be where till the end. But by running 'dd' writers
in parallel we can regularly trigger ENOSPC but only for a limited
periods of time because each time it opens the same file with O_TRUNC.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
264 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
264.out | 5 +++
group | 1 +
3 files changed, 92 insertions(+), 0 deletions(-)
create mode 100755 264
create mode 100644 264.out
diff --git a/264 b/264
new file mode 100755
index 0000000..fc6df23
--- /dev/null
+++ b/264
@@ -0,0 +1,86 @@
+#! /bin/bash
+# FSQA Test No. 264
+#
+# Run fsstress and ENSPC hitters in parallel, check fs consistency an the end
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=dmonakhov@openvz.org
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+# Disable all sync operations to get higher load
+FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
+_workout()
+{
+ echo ""
+ echo "Run fsstress"
+ echo ""
+ num_iterations=10
+ enospc_time=2
+ out=$SCRATCH_MNT/fsstress.$$
+ args="-p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out"
+ echo "fsstress $args" >> $here/$seq.full
+ $FSSTRESS_PROG $args > /dev/null 2>&1 &
+ pid=$!
+ echo "Run dd writers in parallel"
+ for ((i=0; i < num_iterations; i++))
+ do
+ # File will be opened with O_TRUNC each time
+ dd if=/dev/zero of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M count=1 \
+ > /dev/null 2>&1
+ sleep $enospc_time
+ done
+ kill $pid
+ wait $pid
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_need_to_be_root
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seq.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+ umount $SCRATCH_DEV 2>/dev/null
+ exit
+fi
+
+if ! _scratch_unmount; then
+ echo "failed to umount"
+ status=1
+ exit
+fi
+_check_scratch_fs
+status=$?
+exit
diff --git a/264.out b/264.out
new file mode 100644
index 0000000..81b50e5
--- /dev/null
+++ b/264.out
@@ -0,0 +1,5 @@
+QA output created by 264
+
+Run fsstress
+
+Run dd writers in parallel
diff --git a/group b/group
index 2a8970c..e79c29b 100644
--- a/group
+++ b/group
@@ -377,3 +377,4 @@ deprecated
261 auto quick quota
262 auto quick quota
263 rw auto quick
+264 auto rw prealloc ioctl enospc
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
During stress testing we want to cover as much code paths as possible
fsstress is very good for this purpose. But it has expandable nature
(disk usage almost continually grow). So once it goes in no ENOSPC
condition it will be where till the end. But by running 'dd' writers
in parallel we can regularly trigger ENOSPC but only for a limited
periods of time because each time it opens the same file with O_TRUNC.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
264 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
264.out | 5 +++
group | 1 +
3 files changed, 92 insertions(+), 0 deletions(-)
create mode 100755 264
create mode 100644 264.out
diff --git a/264 b/264
new file mode 100755
index 0000000..fc6df23
--- /dev/null
+++ b/264
@@ -0,0 +1,86 @@
+#! /bin/bash
+# FSQA Test No. 264
+#
+# Run fsstress and ENSPC hitters in parallel, check fs consistency an the end
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=dmonakhov@openvz.org
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+# Disable all sync operations to get higher load
+FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
+_workout()
+{
+ echo ""
+ echo "Run fsstress"
+ echo ""
+ num_iterations=10
+ enospc_time=2
+ out=$SCRATCH_MNT/fsstress.$$
+ args="-p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out"
+ echo "fsstress $args" >> $here/$seq.full
+ $FSSTRESS_PROG $args > /dev/null 2>&1 &
+ pid=$!
+ echo "Run dd writers in parallel"
+ for ((i=0; i < num_iterations; i++))
+ do
+ # File will be opened with O_TRUNC each time
+ dd if=/dev/zero of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M count=1 \
+ > /dev/null 2>&1
+ sleep $enospc_time
+ done
+ kill $pid
+ wait $pid
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_need_to_be_root
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seq.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+ umount $SCRATCH_DEV 2>/dev/null
+ exit
+fi
+
+if ! _scratch_unmount; then
+ echo "failed to umount"
+ status=1
+ exit
+fi
+_check_scratch_fs
+status=$?
+exit
diff --git a/264.out b/264.out
new file mode 100644
index 0000000..81b50e5
--- /dev/null
+++ b/264.out
@@ -0,0 +1,5 @@
+QA output created by 264
+
+Run fsstress
+
+Run dd writers in parallel
diff --git a/group b/group
index 2a8970c..e79c29b 100644
--- a/group
+++ b/group
@@ -377,3 +377,4 @@ deprecated
261 auto quick quota
262 auto quick quota
263 rw auto quick
+264 auto rw prealloc ioctl enospc
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 8/8] xfstests: add a new quota test that runs fsstress under ENOSPC conditions
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-10-29 0:48 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: xfs, hch, aelder, Dmitry Monakhov
- Same as 264 but with quota enabled.
- IO performed from $qa_user
- fsstress granted with CAP_CHOWN capability.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
265 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
265.out | 8 +++++
group | 1 +
3 files changed, 117 insertions(+), 0 deletions(-)
create mode 100755 265
create mode 100644 265.out
diff --git a/265 b/265
new file mode 100755
index 0000000..b568fdd
--- /dev/null
+++ b/265
@@ -0,0 +1,108 @@
+#! /bin/bash
+# FSQA Test No. 265
+#
+# Run fsstress and ENSPC hitters in parallel, check quota and
+# fs consistency an the end
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=dmonakhov@openvz.org
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+# Disable all sync operations to get higher load
+FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
+_workout()
+{
+ echo ""
+ echo "Run fsstress"
+ echo ""
+ num_iterations=10
+ enospc_time=2
+ out=$SCRATCH_MNT/fsstress.$$
+ args="-p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out"
+ echo "fsstress $args" >> $here/$seq.full
+ # Grant chown capability
+ cp $FSSTRESS_PROG $tmp.fsstress.bin
+ setcap cap_chown=epi $tmp.fsstress.bin
+
+ (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1
+ pid=$!
+
+ echo "Run dd writers in parallel"
+ for ((i=0; i < num_iterations; i++))
+ do
+ # File will be opened with O_TRUNC each time
+ su $qa_user -c "dd if=/dev/zero \
+ of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M " \
+ > /dev/null 2>&1
+ sleep $enospc_time
+ done
+
+ killall $tmp.fsstress.bin
+ wait $pid
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_user
+_need_to_be_root
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+chmod 777 $SCRATCH_MNT
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+
+if ! _workout; then
+ _scratch_unmount 2>/dev/null
+ exit
+fi
+
+if ! _check_quota_usage; then
+ _scratch_unmount 2>/dev/null
+ status=1
+ exit
+fi
+
+echo Comparing filesystem consistency
+if ! _scratch_unmount; then
+ echo "failed to umount"
+ status=1
+ exit
+fi
+_check_scratch_fs
+status=$?
+exit
diff --git a/265.out b/265.out
new file mode 100644
index 0000000..7637291
--- /dev/null
+++ b/265.out
@@ -0,0 +1,8 @@
+QA output created by 265
+
+Run fsstress
+
+Run dd writers in parallel
+Comparing user usage
+Comparing group usage
+Comparing filesystem consistency
diff --git a/group b/group
index e79c29b..487051a 100644
--- a/group
+++ b/group
@@ -378,3 +378,4 @@ deprecated
262 auto quick quota
263 rw auto quick
264 auto rw prealloc ioctl enospc
+265 auto quota rw prealloc ioctl enospc
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 8/8] xfstests: add a new quota test that runs fsstress under ENOSPC conditions
@ 2011-10-29 0:48 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-29 0:48 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Dmitry Monakhov, aelder, hch, xfs
- Same as 264 but with quota enabled.
- IO performed from $qa_user
- fsstress granted with CAP_CHOWN capability.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
265 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
265.out | 8 +++++
group | 1 +
3 files changed, 117 insertions(+), 0 deletions(-)
create mode 100755 265
create mode 100644 265.out
diff --git a/265 b/265
new file mode 100755
index 0000000..b568fdd
--- /dev/null
+++ b/265
@@ -0,0 +1,108 @@
+#! /bin/bash
+# FSQA Test No. 265
+#
+# Run fsstress and ENSPC hitters in parallel, check quota and
+# fs consistency an the end
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=dmonakhov@openvz.org
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+# Disable all sync operations to get higher load
+FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
+_workout()
+{
+ echo ""
+ echo "Run fsstress"
+ echo ""
+ num_iterations=10
+ enospc_time=2
+ out=$SCRATCH_MNT/fsstress.$$
+ args="-p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out"
+ echo "fsstress $args" >> $here/$seq.full
+ # Grant chown capability
+ cp $FSSTRESS_PROG $tmp.fsstress.bin
+ setcap cap_chown=epi $tmp.fsstress.bin
+
+ (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1
+ pid=$!
+
+ echo "Run dd writers in parallel"
+ for ((i=0; i < num_iterations; i++))
+ do
+ # File will be opened with O_TRUNC each time
+ su $qa_user -c "dd if=/dev/zero \
+ of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M " \
+ > /dev/null 2>&1
+ sleep $enospc_time
+ done
+
+ killall $tmp.fsstress.bin
+ wait $pid
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_user
+_need_to_be_root
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+chmod 777 $SCRATCH_MNT
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+
+if ! _workout; then
+ _scratch_unmount 2>/dev/null
+ exit
+fi
+
+if ! _check_quota_usage; then
+ _scratch_unmount 2>/dev/null
+ status=1
+ exit
+fi
+
+echo Comparing filesystem consistency
+if ! _scratch_unmount; then
+ echo "failed to umount"
+ status=1
+ exit
+fi
+_check_scratch_fs
+status=$?
+exit
diff --git a/265.out b/265.out
new file mode 100644
index 0000000..7637291
--- /dev/null
+++ b/265.out
@@ -0,0 +1,8 @@
+QA output created by 265
+
+Run fsstress
+
+Run dd writers in parallel
+Comparing user usage
+Comparing group usage
+Comparing filesystem consistency
diff --git a/group b/group
index e79c29b..487051a 100644
--- a/group
+++ b/group
@@ -378,3 +378,4 @@ deprecated
262 auto quick quota
263 rw auto quick
264 auto rw prealloc ioctl enospc
+265 auto quota rw prealloc ioctl enospc
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-11-02 19:53 ` Christoph Hellwig
-1 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-02 19:53 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: linux-fsdevel, aelder, hch, xfs
On Sat, Oct 29, 2011 at 04:48:16AM +0400, Dmitry Monakhov wrote:
> During stress testing we want to cover as much code paths as possible
> fsstress is very good for this purpose. But it has expandable nature
> (disk usage almost continually grow). So once it goes in no ENOSPC
> condition it will be where till the end. But by running 'dd' writers
> in parallel we can regularly trigger ENOSPC but only for a limited
> periods of time because each time it opens the same file with O_TRUNC.
This fails for me on XFS because the fsstress process has already
finished by the time you try to kill it:
--- 266.out 2011-11-02 19:46:27.000000000 +0000
+++ 266.out.bad 2011-11-02 19:48:33.000000000 +0000
@@ -3,3 +3,4 @@
Run fsstress
Run dd writers in parallel
+./266: line 60: kill: (3403) - No such process
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
@ 2011-11-02 19:53 ` Christoph Hellwig
0 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-02 19:53 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: linux-fsdevel, xfs, hch, aelder
On Sat, Oct 29, 2011 at 04:48:16AM +0400, Dmitry Monakhov wrote:
> During stress testing we want to cover as much code paths as possible
> fsstress is very good for this purpose. But it has expandable nature
> (disk usage almost continually grow). So once it goes in no ENOSPC
> condition it will be where till the end. But by running 'dd' writers
> in parallel we can regularly trigger ENOSPC but only for a limited
> periods of time because each time it opens the same file with O_TRUNC.
This fails for me on XFS because the fsstress process has already
finished by the time you try to kill it:
--- 266.out 2011-11-02 19:46:27.000000000 +0000
+++ 266.out.bad 2011-11-02 19:48:33.000000000 +0000
@@ -3,3 +3,4 @@
Run fsstress
Run dd writers in parallel
+./266: line 60: kill: (3403) - No such process
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-10-29 0:48 ` Dmitry Monakhov
@ 2011-11-02 19:55 ` Christoph Hellwig
-1 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-02 19:55 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: linux-fsdevel, aelder, hch, xfs
On Sat, Oct 29, 2011 at 04:48:15AM +0400, Dmitry Monakhov wrote:
> Related bug: http://patchwork.ozlabs.org/patch/118863
>
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
This causes a very weird XFS failure in test 117 for me. While it
obviously is an xfs bug that you uncovered (good!) I'm a bit worried
about simply enabling operations in existing tests.
Alex, Eric, Dave - should we add new tests with the new operations
Dmitry added, or is adding new ops to the existing tests fine?
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-11-02 19:55 ` Christoph Hellwig
0 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-02 19:55 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: linux-fsdevel, xfs, hch, aelder
On Sat, Oct 29, 2011 at 04:48:15AM +0400, Dmitry Monakhov wrote:
> Related bug: http://patchwork.ozlabs.org/patch/118863
>
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
This causes a very weird XFS failure in test 117 for me. While it
obviously is an xfs bug that you uncovered (good!) I'm a bit worried
about simply enabling operations in existing tests.
Alex, Eric, Dave - should we add new tests with the new operations
Dmitry added, or is adding new ops to the existing tests fine?
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
2011-11-02 19:53 ` Christoph Hellwig
@ 2011-11-02 20:36 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-02 20:36 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel, aelder, hch, xfs
On Wed, 2 Nov 2011 15:53:58 -0400, Christoph Hellwig <hch@infradead.org> wrote:
> On Sat, Oct 29, 2011 at 04:48:16AM +0400, Dmitry Monakhov wrote:
> > During stress testing we want to cover as much code paths as possible
> > fsstress is very good for this purpose. But it has expandable nature
> > (disk usage almost continually grow). So once it goes in no ENOSPC
> > condition it will be where till the end. But by running 'dd' writers
> > in parallel we can regularly trigger ENOSPC but only for a limited
> > periods of time because each time it opens the same file with O_TRUNC.
>
> This fails for me on XFS because the fsstress process has already
> finished by the time you try to kill it:
>
> --- 266.out 2011-11-02 19:46:27.000000000 +0000
> +++ 266.out.bad 2011-11-02 19:48:33.000000000 +0000
> @@ -3,3 +3,4 @@
> Run fsstress
>
> Run dd writers in parallel
> +./266: line 60: kill: (3403) - No such process
Strange... this means that parent process died unexpectedly.
Works fine fore me. In my case this happen once due to unknown
options(new opt " -fsetattr=1" passed to fsstress explicitly) because i've
forget to rebuilt fsstress via make. Can you please explicitly rebuild,
and check one more time to be 100% sure.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevecalll" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
@ 2011-11-02 20:36 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-02 20:36 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel, xfs, hch, aelder
On Wed, 2 Nov 2011 15:53:58 -0400, Christoph Hellwig <hch@infradead.org> wrote:
> On Sat, Oct 29, 2011 at 04:48:16AM +0400, Dmitry Monakhov wrote:
> > During stress testing we want to cover as much code paths as possible
> > fsstress is very good for this purpose. But it has expandable nature
> > (disk usage almost continually grow). So once it goes in no ENOSPC
> > condition it will be where till the end. But by running 'dd' writers
> > in parallel we can regularly trigger ENOSPC but only for a limited
> > periods of time because each time it opens the same file with O_TRUNC.
>
> This fails for me on XFS because the fsstress process has already
> finished by the time you try to kill it:
>
> --- 266.out 2011-11-02 19:46:27.000000000 +0000
> +++ 266.out.bad 2011-11-02 19:48:33.000000000 +0000
> @@ -3,3 +3,4 @@
> Run fsstress
>
> Run dd writers in parallel
> +./266: line 60: kill: (3403) - No such process
Strange... this means that parent process died unexpectedly.
Works fine fore me. In my case this happen once due to unknown
options(new opt " -fsetattr=1" passed to fsstress explicitly) because i've
forget to rebuilt fsstress via make. Can you please explicitly rebuild,
and check one more time to be 100% sure.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevecalll" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
2011-11-02 20:36 ` Dmitry Monakhov
@ 2011-11-02 21:06 ` Christoph Hellwig
-1 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-02 21:06 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: Christoph Hellwig, linux-fsdevel, xfs, hch, aelder
On Thu, Nov 03, 2011 at 12:36:36AM +0400, Dmitry Monakhov wrote:
> Strange... this means that parent process died unexpectedly.
> Works fine fore me. In my case this happen once due to unknown
> options(new opt " -fsetattr=1" passed to fsstress explicitly) because i've
> forget to rebuilt fsstress via make. Can you please explicitly rebuild,
> and check one more time to be 100% sure.
Oh, looks like it wanted the setattr option. I held back all the new
features for now until we figure if we want them for existing tests.
I've applied and pushed out the first three patches for now, the others
should follow as soon as I've decided on what to do with new operations.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions
@ 2011-11-02 21:06 ` Christoph Hellwig
0 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-02 21:06 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: Christoph Hellwig, linux-fsdevel, aelder, hch, xfs
On Thu, Nov 03, 2011 at 12:36:36AM +0400, Dmitry Monakhov wrote:
> Strange... this means that parent process died unexpectedly.
> Works fine fore me. In my case this happen once due to unknown
> options(new opt " -fsetattr=1" passed to fsstress explicitly) because i've
> forget to rebuilt fsstress via make. Can you please explicitly rebuild,
> and check one more time to be 100% sure.
Oh, looks like it wanted the setattr option. I held back all the new
features for now until we figure if we want them for existing tests.
I've applied and pushed out the first three patches for now, the others
should follow as soon as I've decided on what to do with new operations.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-11-02 19:55 ` Christoph Hellwig
@ 2011-11-03 9:34 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-03 9:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel, aelder, hch, xfs
On Wed, 2 Nov 2011 15:55:34 -0400, Christoph Hellwig <hch@infradead.org> wrote:
> On Sat, Oct 29, 2011 at 04:48:15AM +0400, Dmitry Monakhov wrote:
> > Related bug: http://patchwork.ozlabs.org/patch/118863
> >
> > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
>
> This causes a very weird XFS failure in test 117 for me. While it
> obviously is an xfs bug that you uncovered (good!) I'm a bit worried
> about simply enabling operations in existing tests.
Ohh. i've got what your are talking about. We can not add new ops
for tests there seed is passed explicitly. And yes i've braked this, but
this is because such frozen tests was written in not determined
way :). Good determined test should has not just seed opt, but also
explicit set of operations. All others (non determined) tests which use
fsstress may benefit from new ops. So I'll redo my patch queue like this:
1) Add explicit option set for all frozen tests
2) Add new features to fssstress with non zero probability.
>
> Alex, Eric, Dave - should we add new tests with the new operations
> Dmitry added, or is adding new ops to the existing tests fine?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-11-03 9:34 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-03 9:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel, xfs, hch, aelder
On Wed, 2 Nov 2011 15:55:34 -0400, Christoph Hellwig <hch@infradead.org> wrote:
> On Sat, Oct 29, 2011 at 04:48:15AM +0400, Dmitry Monakhov wrote:
> > Related bug: http://patchwork.ozlabs.org/patch/118863
> >
> > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
>
> This causes a very weird XFS failure in test 117 for me. While it
> obviously is an xfs bug that you uncovered (good!) I'm a bit worried
> about simply enabling operations in existing tests.
Ohh. i've got what your are talking about. We can not add new ops
for tests there seed is passed explicitly. And yes i've braked this, but
this is because such frozen tests was written in not determined
way :). Good determined test should has not just seed opt, but also
explicit set of operations. All others (non determined) tests which use
fsstress may benefit from new ops. So I'll redo my patch queue like this:
1) Add explicit option set for all frozen tests
2) Add new features to fssstress with non zero probability.
>
> Alex, Eric, Dave - should we add new tests with the new operations
> Dmitry added, or is adding new ops to the existing tests fine?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-11-02 19:55 ` Christoph Hellwig
@ 2011-11-03 10:54 ` Theodore Tso
-1 siblings, 0 replies; 42+ messages in thread
From: Theodore Tso @ 2011-11-03 10:54 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Theodore Tso, Dmitry Monakhov, linux-fsdevel, aelder, hch, xfs
On Nov 2, 2011, at 3:55 PM, Christoph Hellwig wrote:
> Alex, Eric, Dave - should we add new tests with the new operations
> Dmitry added, or is adding new ops to the existing tests fine?
One argument for adding new ops to existing tests is that it makes the run time of the entire test suite take longer. A QA pass is already taking quite a while, and it would be nice if we could keep xfstests as efficient as possible in terms of the maximum testing coverage per time spent running the test suite….
-- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-11-03 10:54 ` Theodore Tso
0 siblings, 0 replies; 42+ messages in thread
From: Theodore Tso @ 2011-11-03 10:54 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Theodore Tso, xfs, Dmitry Monakhov, aelder, linux-fsdevel, hch
On Nov 2, 2011, at 3:55 PM, Christoph Hellwig wrote:
> Alex, Eric, Dave - should we add new tests with the new operations
> Dmitry added, or is adding new ops to the existing tests fine?
One argument for adding new ops to existing tests is that it makes the run time of the entire test suite take longer. A QA pass is already taking quite a while, and it would be nice if we could keep xfstests as efficient as possible in terms of the maximum testing coverage per time spent running the test suite….
-- Ted
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-11-03 10:54 ` Theodore Tso
@ 2011-11-03 11:04 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-03 11:04 UTC (permalink / raw)
To: Theodore Tso, Christoph Hellwig
Cc: Theodore Tso, linux-fsdevel, aelder, hch, xfs
On Thu, 3 Nov 2011 06:54:16 -0400, Theodore Tso <tytso@mit.edu> wrote:
>
> On Nov 2, 2011, at 3:55 PM, Christoph Hellwig wrote:
>
> > Alex, Eric, Dave - should we add new tests with the new operations
> > Dmitry added, or is adding new ops to the existing tests fine?
>
> One argument for adding new ops to existing tests is that it makes the run time of the entire test suite take longer. A QA pass is already taking quite a while, and it would be nice if we could keep xfstests as efficient as possible in terms of the maximum testing coverage per time spent running the test suite….
Yes, but regression test with explicit seed option should be
preserved. Number of such test is not too big, so it is reasonable to
hardcode set of operations in such tests and let all others use new features.
>
> -- Ted
>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-11-03 11:04 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-03 11:04 UTC (permalink / raw)
To: Theodore Tso, Christoph Hellwig; +Cc: linux-fsdevel, xfs, hch, aelder
On Thu, 3 Nov 2011 06:54:16 -0400, Theodore Tso <tytso@mit.edu> wrote:
>
> On Nov 2, 2011, at 3:55 PM, Christoph Hellwig wrote:
>
> > Alex, Eric, Dave - should we add new tests with the new operations
> > Dmitry added, or is adding new ops to the existing tests fine?
>
> One argument for adding new ops to existing tests is that it makes the run time of the entire test suite take longer. A QA pass is already taking quite a while, and it would be nice if we could keep xfstests as efficient as possible in terms of the maximum testing coverage per time spent running the test suite….
Yes, but regression test with explicit seed option should be
preserved. Number of such test is not too big, so it is reasonable to
hardcode set of operations in such tests and let all others use new features.
>
> -- Ted
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-11-03 9:34 ` Dmitry Monakhov
@ 2011-11-03 12:14 ` Dmitry Monakhov
-1 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-03 12:14 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel, aelder, hch, xfs
On Thu, 03 Nov 2011 13:34:41 +0400, Dmitry Monakhov <dmonakhov@openvz.org> wrote:
> On Wed, 2 Nov 2011 15:55:34 -0400, Christoph Hellwig <hch@infradead.org> wrote:
> > On Sat, Oct 29, 2011 at 04:48:15AM +0400, Dmitry Monakhov wrote:
> > > Related bug: http://patchwork.ozlabs.org/patch/118863
> > >
> > > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> >
> > This causes a very weird XFS failure in test 117 for me. While it
> > obviously is an xfs bug that you uncovered (good!) I'm a bit worried
> > about simply enabling operations in existing tests.
> Ohh. i've got what your are talking about. We can not add new ops
> for tests there seed is passed explicitly. And yes i've braked this, but
> this is because such frozen tests was written in not determined
> way :). Good determined test should has not just seed opt, but also
> explicit set of operations. All others (non determined) tests which use
> fsstress may benefit from new ops. So I'll redo my patch queue like this:
> 1) Add explicit option set for all frozen tests
i've stuck immediately on first test ;(.
on my kernel 107'th test always failed (commit: 73a57c642cdfa660
"1.1.0 release"), is it expected? Which xfs-tree and commit should i use?
> 2) Add new features to fssstress with non zero probability.
> >
> > Alex, Eric, Dave - should we add new tests with the new operations
> > Dmitry added, or is adding new ops to the existing tests fine?
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-11-03 12:14 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-11-03 12:14 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel, xfs, hch, aelder
On Thu, 03 Nov 2011 13:34:41 +0400, Dmitry Monakhov <dmonakhov@openvz.org> wrote:
> On Wed, 2 Nov 2011 15:55:34 -0400, Christoph Hellwig <hch@infradead.org> wrote:
> > On Sat, Oct 29, 2011 at 04:48:15AM +0400, Dmitry Monakhov wrote:
> > > Related bug: http://patchwork.ozlabs.org/patch/118863
> > >
> > > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> >
> > This causes a very weird XFS failure in test 117 for me. While it
> > obviously is an xfs bug that you uncovered (good!) I'm a bit worried
> > about simply enabling operations in existing tests.
> Ohh. i've got what your are talking about. We can not add new ops
> for tests there seed is passed explicitly. And yes i've braked this, but
> this is because such frozen tests was written in not determined
> way :). Good determined test should has not just seed opt, but also
> explicit set of operations. All others (non determined) tests which use
> fsstress may benefit from new ops. So I'll redo my patch queue like this:
> 1) Add explicit option set for all frozen tests
i've stuck immediately on first test ;(.
on my kernel 107'th test always failed (commit: 73a57c642cdfa660
"1.1.0 release"), is it expected? Which xfs-tree and commit should i use?
> 2) Add new features to fssstress with non zero probability.
> >
> > Alex, Eric, Dave - should we add new tests with the new operations
> > Dmitry added, or is adding new ops to the existing tests fine?
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-11-03 12:14 ` Dmitry Monakhov
@ 2011-11-03 12:28 ` Christoph Hellwig
-1 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-03 12:28 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: Christoph Hellwig, linux-fsdevel, xfs, hch, aelder
On Thu, Nov 03, 2011 at 04:14:04PM +0400, Dmitry Monakhov wrote:
> i've stuck immediately on first test ;(.
> on my kernel 107'th test always failed (commit: 73a57c642cdfa660
> "1.1.0 release"), is it expected? Which xfs-tree and commit should i use?
106 and 107 have been failing basically forever - that's why they aren't
part of the auto group.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-11-03 12:28 ` Christoph Hellwig
0 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-11-03 12:28 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: Christoph Hellwig, linux-fsdevel, aelder, hch, xfs
On Thu, Nov 03, 2011 at 04:14:04PM +0400, Dmitry Monakhov wrote:
> i've stuck immediately on first test ;(.
> on my kernel 107'th test always failed (commit: 73a57c642cdfa660
> "1.1.0 release"), is it expected? Which xfs-tree and commit should i use?
106 and 107 have been failing basically forever - that's why they aren't
part of the auto group.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
2011-11-03 11:04 ` Dmitry Monakhov
@ 2011-11-03 16:05 ` Ted Ts'o
-1 siblings, 0 replies; 42+ messages in thread
From: Ted Ts'o @ 2011-11-03 16:05 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: Christoph Hellwig, linux-fsdevel, aelder, hch, xfs
On Thu, Nov 03, 2011 at 03:04:17PM +0400, Dmitry Monakhov wrote:
> On Thu, 3 Nov 2011 06:54:16 -0400, Theodore Tso <tytso@mit.edu> wrote:
> >
> > On Nov 2, 2011, at 3:55 PM, Christoph Hellwig wrote:
> >
> > > Alex, Eric, Dave - should we add new tests with the new operations
> > > Dmitry added, or is adding new ops to the existing tests fine?
> >
> > One argument for adding new ops to existing tests is that it makes
> > the run time of the entire test suite take longer. A QA pass is
> > already taking quite a while, and it would be nice if we could
> > keep xfstests as efficient as possible in terms of the maximum
> > testing coverage per time spent running the test suite….
>
> Yes, but regression test with explicit seed option should be
> preserved. Number of such test is not too big, so it is reasonable to
> hardcode set of operations in such tests and let all others use new features.
That's not what I was talking about. Of course there should be a way
to run a regression test with an explicit seed option (although in
general I think a specific test in xfstests should by default use a
random seed, and have a way to easily specify an explicit seed without
having to reverse engineer the test and running fsstress manually).
What I was talking about was the fact we already have several (half a
dozen or so, if memory serves correctly) xfstests that use fsstress
with a different set of fsstress options. In some cases it makes to
add a new numbered xfstest subtest, but I'd rather not find that we've
doubled the number of tests using fsstress in the future, and with it,
doubled the run-time of the auto or quick xfstests group....
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 6/8] xfstests: add fiemap operation to fsstress
@ 2011-11-03 16:05 ` Ted Ts'o
0 siblings, 0 replies; 42+ messages in thread
From: Ted Ts'o @ 2011-11-03 16:05 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: Christoph Hellwig, linux-fsdevel, xfs, hch, aelder
On Thu, Nov 03, 2011 at 03:04:17PM +0400, Dmitry Monakhov wrote:
> On Thu, 3 Nov 2011 06:54:16 -0400, Theodore Tso <tytso@mit.edu> wrote:
> >
> > On Nov 2, 2011, at 3:55 PM, Christoph Hellwig wrote:
> >
> > > Alex, Eric, Dave - should we add new tests with the new operations
> > > Dmitry added, or is adding new ops to the existing tests fine?
> >
> > One argument for adding new ops to existing tests is that it makes
> > the run time of the entire test suite take longer. A QA pass is
> > already taking quite a while, and it would be nice if we could
> > keep xfstests as efficient as possible in terms of the maximum
> > testing coverage per time spent running the test suite….
>
> Yes, but regression test with explicit seed option should be
> preserved. Number of such test is not too big, so it is reasonable to
> hardcode set of operations in such tests and let all others use new features.
That's not what I was talking about. Of course there should be a way
to run a regression test with an explicit seed option (although in
general I think a specific test in xfstests should by default use a
random seed, and have a way to easily specify an explicit seed without
having to reverse engineer the test and running fsstress manually).
What I was talking about was the fact we already have several (half a
dozen or so, if memory serves correctly) xfstests that use fsstress
with a different set of fsstress options. In some cases it makes to
add a new numbered xfstest subtest, but I'd rather not find that we've
doubled the number of tests using fsstress in the future, and with it,
doubled the run-time of the auto or quick xfstests group....
- Ted
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/8] xfstests: add different logging option to fsstress
2011-10-19 10:29 ` Dmitry Monakhov
@ 2011-10-24 9:15 ` Christoph Hellwig
-1 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-10-24 9:15 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: linux-fsdevel, xfs, linux-ext4, jack, hch, aelder
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/8] xfstests: add different logging option to fsstress
@ 2011-10-24 9:15 ` Christoph Hellwig
0 siblings, 0 replies; 42+ messages in thread
From: Christoph Hellwig @ 2011-10-24 9:15 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: jack, xfs, hch, aelder, linux-fsdevel, linux-ext4
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 2/8] xfstests: add different logging option to fsstress
2011-10-19 10:29 [PATCH 0/8] xfstests: Bunch of new tests Dmitry Monakhov
@ 2011-10-19 10:29 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-19 10:29 UTC (permalink / raw)
To: linux-fsdevel, xfs, linux-ext4, jack, hch, aelder; +Cc: Dmitry Monakhov
Currently the only way to log fsstress's output is to redirect it's shared
stdout to pipe which is very painfull because:
1) Pipe writers are serialized via i_mutex so we waste cpu-cores power on stupid
sinchronization for loging purpose, instead of hunting real race conditions,
and bugs inside file system.
2) Usually output is corrupted due to luck of sychronization on shared stdout.
Since fsstress's children operate on independend paths, let's just open didicated
log file for each child and simply avoid useless sycnhronization.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 34adacc..385d5a0 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -265,6 +265,8 @@ int main(int argc, char **argv)
char buf[10];
int c;
char *dirname = NULL;
+ char *logname = NULL;
+ char rpath[PATH_MAX];
int fd;
int i;
int j;
@@ -281,7 +283,7 @@ int main(int argc, char **argv)
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
- while ((c = getopt(argc, argv, "d:e:f:i:m:n:p:rs:vwzHS")) != -1) {
+ while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHS")) != -1) {
switch (c) {
case 'd':
dirname = optarg;
@@ -319,6 +321,10 @@ int main(int argc, char **argv)
case 'n':
operations = atoi(optarg);
break;
+ case 'o':
+ logname = optarg;
+ break;
+
case 'p':
nproc = atoi(optarg);
break;
@@ -359,10 +365,26 @@ int main(int argc, char **argv)
}
(void)mkdir(dirname, 0777);
+ if (logname && logname[0] != '/') {
+ if (getcwd(rpath, sizeof(rpath)) < 0){
+ perror("getcwd failed");
+ exit(1);
+ }
+ } else {
+ rpath[0] = '\0';
+ }
if (chdir(dirname) < 0) {
perror(dirname);
exit(1);
}
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s", rpath, logname);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
sprintf(buf, "fss%x", (unsigned int)getpid());
fd = creat(buf, 0666);
if (lseek64(fd, (off64_t)(MAXFSIZE32 + 1ULL), SEEK_SET) < 0)
@@ -436,6 +458,14 @@ int main(int argc, char **argv)
if (getppid() == 1) /* parent died already? */
return 0;
#endif
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s.%d", rpath, logname, i);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
procid = i;
doproc();
return 0;
--
1.7.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/8] xfstests: add different logging option to fsstress
@ 2011-10-19 10:29 ` Dmitry Monakhov
0 siblings, 0 replies; 42+ messages in thread
From: Dmitry Monakhov @ 2011-10-19 10:29 UTC (permalink / raw)
To: linux-fsdevel, xfs, linux-ext4, jack, hch, aelder; +Cc: Dmitry Monakhov
Currently the only way to log fsstress's output is to redirect it's shared
stdout to pipe which is very painfull because:
1) Pipe writers are serialized via i_mutex so we waste cpu-cores power on stupid
sinchronization for loging purpose, instead of hunting real race conditions,
and bugs inside file system.
2) Usually output is corrupted due to luck of sychronization on shared stdout.
Since fsstress's children operate on independend paths, let's just open didicated
log file for each child and simply avoid useless sycnhronization.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
ltp/fsstress.c | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 34adacc..385d5a0 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -265,6 +265,8 @@ int main(int argc, char **argv)
char buf[10];
int c;
char *dirname = NULL;
+ char *logname = NULL;
+ char rpath[PATH_MAX];
int fd;
int i;
int j;
@@ -281,7 +283,7 @@ int main(int argc, char **argv)
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
- while ((c = getopt(argc, argv, "d:e:f:i:m:n:p:rs:vwzHS")) != -1) {
+ while ((c = getopt(argc, argv, "d:e:f:i:m:n:o:p:rs:vwzHS")) != -1) {
switch (c) {
case 'd':
dirname = optarg;
@@ -319,6 +321,10 @@ int main(int argc, char **argv)
case 'n':
operations = atoi(optarg);
break;
+ case 'o':
+ logname = optarg;
+ break;
+
case 'p':
nproc = atoi(optarg);
break;
@@ -359,10 +365,26 @@ int main(int argc, char **argv)
}
(void)mkdir(dirname, 0777);
+ if (logname && logname[0] != '/') {
+ if (getcwd(rpath, sizeof(rpath)) < 0){
+ perror("getcwd failed");
+ exit(1);
+ }
+ } else {
+ rpath[0] = '\0';
+ }
if (chdir(dirname) < 0) {
perror(dirname);
exit(1);
}
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s", rpath, logname);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
sprintf(buf, "fss%x", (unsigned int)getpid());
fd = creat(buf, 0666);
if (lseek64(fd, (off64_t)(MAXFSIZE32 + 1ULL), SEEK_SET) < 0)
@@ -436,6 +458,14 @@ int main(int argc, char **argv)
if (getppid() == 1) /* parent died already? */
return 0;
#endif
+ if (logname) {
+ char path[PATH_MAX];
+ snprintf(path, sizeof(path), "%s/%s.%d", rpath, logname, i);
+ if (freopen(path, "a", stdout) == NULL) {
+ perror("freopen logfile failed");
+ exit(1);
+ }
+ }
procid = i;
doproc();
return 0;
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 42+ messages in thread
end of thread, other threads:[~2011-11-03 16:06 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-29 0:48 [PATCH 0/8] xfstests: Bunch of new stress tests -v3 Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
2011-10-29 0:48 ` [PATCH 1/8] xfstests: fsstress dump inode info when possible Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
2011-10-29 0:48 ` [PATCH 2/8] xfstests: add different logging option to fsstress Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
2011-10-29 0:48 ` [PATCH 3/8] xfstests: fsstress should kill children tasks before exit Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
2011-10-29 0:48 ` [PATCH 4/8] xfstests: add fallocate support to fsstress Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
2011-10-29 0:48 ` [PATCH 5/8] xfstests: fsstress add FS_IOC_{SET,GET}FLAGS operations v2 Dmitry Monakhov
2011-10-29 0:48 ` [PATCH 5/8] xfstests: fsstress add FS_IOC_{SET, GET}FLAGS " Dmitry Monakhov
2011-10-29 0:48 ` [PATCH 6/8] xfstests: add fiemap operation to fsstress Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
2011-11-02 19:55 ` Christoph Hellwig
2011-11-02 19:55 ` Christoph Hellwig
2011-11-03 9:34 ` Dmitry Monakhov
2011-11-03 9:34 ` Dmitry Monakhov
2011-11-03 12:14 ` Dmitry Monakhov
2011-11-03 12:14 ` Dmitry Monakhov
2011-11-03 12:28 ` Christoph Hellwig
2011-11-03 12:28 ` Christoph Hellwig
2011-11-03 10:54 ` Theodore Tso
2011-11-03 10:54 ` Theodore Tso
2011-11-03 11:04 ` Dmitry Monakhov
2011-11-03 11:04 ` Dmitry Monakhov
2011-11-03 16:05 ` Ted Ts'o
2011-11-03 16:05 ` Ted Ts'o
2011-10-29 0:48 ` [PATCH 7/8] xfstests: add a new test that runs fsstress under ENOSPC conditions Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
2011-11-02 19:53 ` Christoph Hellwig
2011-11-02 19:53 ` Christoph Hellwig
2011-11-02 20:36 ` Dmitry Monakhov
2011-11-02 20:36 ` Dmitry Monakhov
2011-11-02 21:06 ` Christoph Hellwig
2011-11-02 21:06 ` Christoph Hellwig
2011-10-29 0:48 ` [PATCH 8/8] xfstests: add a new quota " Dmitry Monakhov
2011-10-29 0:48 ` Dmitry Monakhov
-- strict thread matches above, loose matches on Subject: below --
2011-10-19 10:29 [PATCH 0/8] xfstests: Bunch of new tests Dmitry Monakhov
2011-10-19 10:29 ` [PATCH 2/8] xfstests: add different logging option to fsstress Dmitry Monakhov
2011-10-19 10:29 ` Dmitry Monakhov
2011-10-24 9:15 ` Christoph Hellwig
2011-10-24 9:15 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.