Skip to content

Commit

Permalink
ztest - skip vdev segregation for small vdevs
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Brady committed Mar 1, 2017
1 parent d0ac6b6 commit 96e4723
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/ztest/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -6641,6 +6641,8 @@ print_time(hrtime_t t, char *timebuf)
(void) sprintf(timebuf, "%llus", s);
}

#define SEGREGATE_MINDEVSIZE (256ULL << 20) /* 256M minimum size */

static nvlist_t *
make_random_props(void)
{
Expand All @@ -6649,7 +6651,8 @@ make_random_props(void)
VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);

/* With mirror or raidz configs, use segregation 20% of the time */
if ((ztest_opts.zo_raidz > 1 || ztest_opts.zo_mirrors > 1) &&
if (ztest_opts.zo_vdev_size >= SEGREGATE_MINDEVSIZE &&
(ztest_opts.zo_raidz > 1 || ztest_opts.zo_mirrors > 1) &&
ztest_random(5) == 0) {
VERIFY(nvlist_add_uint64(props, "segregate_log", 1) == 0);
VERIFY(nvlist_add_uint64(props, "segregate_metadata", 1) == 0);
Expand Down

0 comments on commit 96e4723

Please sign in to comment.