From e05725b117836db173257fae43fb0746eb857fb5 Mon Sep 17 00:00:00 2001 From: bonwick Date: Tue, 27 Nov 2007 22:58:05 -0800 Subject: 6354519 stack overflow in zfs due to zio pipeline 6533726 single-threaded checksum & parity calculations limit write bandwidth 6547248 ztest detects a future leak when there is none 6604198 zfs only using single cpu for compression (part II) --HG-- rename : usr/src/uts/common/fs/zfs/rprwlock.c => deleted_files/usr/src/uts/common/fs/zfs/rprwlock.c rename : usr/src/uts/common/fs/zfs/sys/rprwlock.h => deleted_files/usr/src/uts/common/fs/zfs/sys/rprwlock.h --- usr/src/uts/common/fs/zfs/metaslab.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'usr/src/uts/common/fs/zfs/metaslab.c') diff --git a/usr/src/uts/common/fs/zfs/metaslab.c b/usr/src/uts/common/fs/zfs/metaslab.c index 589dc7e3de..9365dbdb14 100644 --- a/usr/src/uts/common/fs/zfs/metaslab.c +++ b/usr/src/uts/common/fs/zfs/metaslab.c @@ -35,6 +35,7 @@ #include uint64_t metaslab_aliquot = 512ULL << 10; +uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ /* * ========================================================================== @@ -727,6 +728,12 @@ metaslab_alloc_dva(spa_t *spa, metaslab_class_t *mc, uint64_t psize, ASSERT(!DVA_IS_VALID(&dva[d])); + /* + * For testing, make some blocks above a certain size be gang blocks. + */ + if (psize >= metaslab_gang_bang && (lbolt & 3) == 0) + return (ENOSPC); + /* * Start at the rotor and loop through all mgs until we find something. * Note that there's no locking on mc_rotor or mc_allocated because -- cgit v1.2.3