Fix location of fsstress and clamp the uid/gid range for chown so as to
limit memory requirements for xfs_db/check afterward.
echo "fsstress.$_n : $_param"
echo "-----------------------------------------------"
# -v >$tmp.out
echo "fsstress.$_n : $_param"
echo "-----------------------------------------------"
# -v >$tmp.out
- if ! $here/src/fsstress $_param $FSSTRESS_AVOID -n $_count -d $out >/dev/null 2>&1
+ # -m limits number of users/groups so check doesn't fail (malloc) later
+ if ! $here/ltp/fsstress $_param $FSSTRESS_AVOID -m 8 -n $_count -d $out >/dev/null 2>&1
then
echo " fsstress (count=$_count) returned $? - see $seq.full"
then
echo " fsstress (count=$_count) returned $? - see $seq.full"
SCRATCH_DEV=/dev/sdb5
SCRATCH_LOGDEV=/dev/sda11
TEST_DIR=/mnt/xfs1
SCRATCH_DEV=/dev/sdb5
SCRATCH_LOGDEV=/dev/sda11
TEST_DIR=/mnt/xfs1
TEST_LOGDEV=/dev/sda9
TAPE_DEV=/dev/st0
RMT_TAPE_DEV=bruce:/dev/st0
TEST_LOGDEV=/dev/sda9
TAPE_DEV=/dev/st0
RMT_TAPE_DEV=bruce:/dev/st0
-
-# extra parameters for fsstress
-FSSTRESS_AVOID=
-
-export AWK_PROG FSSTRESS_AVOID
# we override mount and mkfs.xfs so we can specify extra options
# we override mount and mkfs.xfs so we can specify extra options
if ! _test_mount
then
echo "common.rc: retrying test device mount with external set"
if ! _test_mount
then
echo "common.rc: retrying test device mount with external set"
- [ "$USE_EXTERNAL" != "yes" ] && USE_EXTERNAL=yes
+ [ "$USE_EXTERNAL" != "yes" ] && export USE_EXTERNAL=yes
if ! _test_mount
then
echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
if ! _test_mount
then
echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
#include <dirent.h>
#define XFS_ERRTAG_MAX 17
#include <dirent.h>
#define XFS_ERRTAG_MAX 17
+#define XFS_IDMODULO_MAX 32
typedef enum {
OP_ALLOCSP,
typedef enum {
OP_ALLOCSP,
int nops;
int nproc = 1;
int operations = 1;
int nops;
int nproc = 1;
int operations = 1;
+unsigned int idmodulo = XFS_IDMODULO_MAX;
int procid;
int rtpct;
unsigned long seed = 0;
int procid;
int rtpct;
unsigned long seed = 0;
int stat;
struct timeval t;
ptrdiff_t srval;
int stat;
struct timeval t;
ptrdiff_t srval;
xfs_error_injection_t err_inj;
errrange = errtag = 0;
xfs_error_injection_t err_inj;
errrange = errtag = 0;
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
nops = sizeof(ops) / sizeof(ops[0]);
ops_end = &ops[nops];
myprog = argv[0];
- while ((c = getopt(argc, argv, "d:e:f:i:n:p:rs:vwzHS")) != -1) {
+ while ((c = getopt(argc, argv, "d:e:f:i:m:n:p:rs:vwzHS")) != -1) {
switch (c) {
case 'd':
dirname = optarg;
switch (c) {
case 'd':
dirname = optarg;
ilist = realloc(ilist, ++ilistlen * sizeof(*ilist));
ilist[ilistlen - 1] = strtol(optarg, &p, 16);
break;
ilist = realloc(ilist, ++ilistlen * sizeof(*ilist));
ilist[ilistlen - 1] = strtol(optarg, &p, 16);
break;
+ case 'm':
+ idmodulo = strtoul(optarg, NULL, 0);
+ if (idmodulo > XFS_IDMODULO_MAX) {
+ fprintf(stderr,
+ "chown modulo %d too big (max %d)\n",
+ idmodulo, XFS_IDMODULO_MAX);
+ exit(1);
+ }
+ break;
case 'n':
operations = atoi(optarg);
break;
case 'n':
operations = atoi(optarg);
break;
printf(" -f op_name=freq changes the frequency of option name to freq\n");
printf(" the valid operation names are:\n");
show_ops(-1, " ");
printf(" -f op_name=freq changes the frequency of option name to freq\n");
printf(" the valid operation names are:\n");
show_ops(-1, " ");
+ printf(" -m modulo uid/gid modulo for chown/chgrp (default 32)\n");
printf(" -n nops specifies the no. of operations per process (default 1)\n");
printf(" -p nproc specifies the no. of processes (default 1)\n");
printf(" -r specifies random name padding\n");
printf(" -n nops specifies the no. of operations per process (default 1)\n");
printf(" -p nproc specifies the no. of processes (default 1)\n");
printf(" -r specifies random name padding\n");
pathname_t f;
int nbits;
uid_t u;
pathname_t f;
int nbits;
uid_t u;
int v;
init_pathname(&f);
if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
append_pathname(&f, ".");
u = (uid_t)random();
int v;
init_pathname(&f);
if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
append_pathname(&f, ".");
u = (uid_t)random();
- nbits = (int)(random() % 32);
+ g = (gid_t)random();
+ nbits = (int)(random() % idmodulo);
- e = lchown_path(&f, u, -1) < 0 ? errno : 0;
+ g &= (1 << nbits) - 1;
+ e = lchown_path(&f, u, g) < 0 ? errno : 0;
- printf("%d/%d: chown %s %d %d\n", procid, opno, f.path, u, e);
+ printf("%d/%d: chown %s %d/%d %d\n", procid, opno, f.path, u, g, e);