diff options
author | Brian Behlendorf <[email protected]> | 2015-02-27 12:53:35 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-03-03 13:22:21 -0800 |
commit | 989fd514b1053d5443b4e6155af9c8d863f5f0f2 (patch) | |
tree | bf21efdd55cfa3ce96ec62ac21aad31e2faedfb6 /module | |
parent | 8c45def24a5c640a3b44ce38cc3482b9c89a3b1d (diff) |
Change ASSERT(!"...") to cmn_err(CE_PANIC, ...)
There are a handful of ASSERT(!"...")'s throughout the code base for
cases which should be impossible. This patch converts them to use
cmn_err(CE_PANIC, ...) to ensure they are always enabled and so that
additional debugging is logged if they were to occur.
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #1445
Diffstat (limited to 'module')
-rw-r--r-- | module/zcommon/zfs_deleg.c | 2 | ||||
-rw-r--r-- | module/zfs/arc.c | 2 | ||||
-rw-r--r-- | module/zfs/dmu_tx.c | 3 | ||||
-rw-r--r-- | module/zfs/zap_leaf.c | 9 | ||||
-rw-r--r-- | module/zfs/zap_micro.c | 2 |
5 files changed, 11 insertions, 7 deletions
diff --git a/module/zcommon/zfs_deleg.c b/module/zcommon/zfs_deleg.c index a152b4e76..f6e41da9d 100644 --- a/module/zcommon/zfs_deleg.c +++ b/module/zcommon/zfs_deleg.c @@ -227,7 +227,7 @@ zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type, ZFS_DELEG_FIELD_SEP_CHR); break; default: - ASSERT(!"bad zfs_deleg_who_type_t"); + cmn_err(CE_PANIC, "bad zfs_deleg_who_type_t %d", type); } } diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 070d85aaf..9a81b4c59 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -2944,7 +2944,7 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock) DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf); arc_change_state(arc_mfu, buf, hash_lock); } else { - ASSERT(!"invalid arc state"); + cmn_err(CE_PANIC, "invalid arc state 0x%p", buf->b_state); } } diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c index 890aecc1d..cdf5a6d0f 100644 --- a/module/zfs/dmu_tx.c +++ b/module/zfs/dmu_tx.c @@ -925,7 +925,8 @@ dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db) match_object = TRUE; break; default: - ASSERT(!"bad txh_type"); + cmn_err(CE_PANIC, "bad txh_type %d", + txh->txh_type); } } if (match_object && match_offset) { diff --git a/module/zfs/zap_leaf.c b/module/zfs/zap_leaf.c index 78f05d7a7..957804825 100644 --- a/module/zfs/zap_leaf.c +++ b/module/zfs/zap_leaf.c @@ -79,8 +79,9 @@ stv(int len, void *addr, uint64_t value) case 8: *(uint64_t *)addr = value; return; + default: + cmn_err(CE_PANIC, "bad int len %d", len); } - ASSERT(!"bad int len"); } static uint64_t @@ -95,8 +96,9 @@ ldv(int len, const void *addr) return (*(uint32_t *)addr); case 8: return (*(uint64_t *)addr); + default: + cmn_err(CE_PANIC, "bad int len %d", len); } - ASSERT(!"bad int len"); return (0xFEEDFACEDEADBEEFULL); } @@ -147,7 +149,8 @@ zap_leaf_byteswap(zap_leaf_phys_t *buf, int size) /* la_array doesn't need swapping */ break; default: - ASSERT(!"bad leaf type"); + cmn_err(CE_PANIC, "bad leaf type %d", + lc->l_free.lf_type); } } } diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c index 0c2e76319..dfa7c6615 100644 --- a/module/zfs/zap_micro.c +++ b/module/zfs/zap_micro.c @@ -965,7 +965,7 @@ again: start = 0; goto again; } - ASSERT(!"out of entries!"); + cmn_err(CE_PANIC, "out of entries!"); } int |