aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2013-02-09 19:25:55 -0500
committerBrian Behlendorf <[email protected]>2013-02-12 10:27:44 -0800
commit8dca0a9a386a7e435889e7d621e5029a15dad612 (patch)
tree21fdeebec7420a3b1344b755008e1a1c30d396e4 /module
parent9878a89d7ab05ffcdcdbf80233d02e30eea511be (diff)
Make spa.c assertions catch unsupported pre-feature flag pool versions
A couple of assertions in spa.c were designed to prevent the use of invalid pool versions. They were written under the assumption that all valid pools are less than SPA_VERSION. Since feature flags jumped from 28 to 5000, any numbers in the range 28 to 5000 non-inclusive will fail to trigger them. We switch to the new SPA_VERSION_IS_SUPPORTED macro to correct this. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1282
Diffstat (limited to 'module')
-rw-r--r--module/zfs/spa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 5b6465f2e..0babf4752 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -5770,7 +5770,7 @@ spa_sync_version(void *arg1, void *arg2, dmu_tx_t *tx)
*/
ASSERT(tx->tx_txg != TXG_INITIAL);
- ASSERT(version <= SPA_VERSION);
+ ASSERT(SPA_VERSION_IS_SUPPORTED(version));
ASSERT(version >= spa_version(spa));
spa->spa_uberblock.ub_version = version;
@@ -6294,7 +6294,7 @@ spa_upgrade(spa_t *spa, uint64_t version)
* future version would result in an unopenable pool, this shouldn't be
* possible.
*/
- ASSERT(spa->spa_uberblock.ub_version <= SPA_VERSION);
+ ASSERT(SPA_VERSION_IS_SUPPORTED(spa->spa_uberblock.ub_version));
ASSERT(version >= spa->spa_uberblock.ub_version);
spa->spa_uberblock.ub_version = version;