# awk
AWK_PROG=awk
-
-# extra parameters for fsstress
-FSSTRESS_AVOID=
-
-export AWK_PROG FSSTRESS_AVOID
+export AWK_PROG
# 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"
- [ "$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"
#include <dirent.h>
#define XFS_ERRTAG_MAX 17
+#define XFS_IDMODULO_MAX 32
typedef enum {
OP_ALLOCSP,
int nops;
int nproc = 1;
int operations = 1;
+unsigned int idmodulo = XFS_IDMODULO_MAX;
int procid;
int rtpct;
unsigned long seed = 0;
int stat;
struct timeval t;
ptrdiff_t srval;
- int nousage=0;
+ int nousage = 0;
xfs_error_injection_t err_inj;
errrange = errtag = 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;
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;
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");
pathname_t f;
int nbits;
uid_t u;
+ gid_t g;
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);
u &= (1 << nbits) - 1;
- e = lchown_path(&f, u, -1) < 0 ? errno : 0;
+ g &= (1 << nbits) - 1;
+ e = lchown_path(&f, u, g) < 0 ? errno : 0;
check_cwd();
if (v)
- 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);
free_pathname(&f);
}