diff options
author | Ying Zhu <[email protected]> | 2013-04-30 11:15:12 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-05-06 14:10:55 -0700 |
commit | ee664d463189d6302877461967afe21ce9d861a0 (patch) | |
tree | d0479010b1061cfda7d4821dad64338a94a81523 /module/zfs/ddt.c | |
parent | 044baf009aac4935eca0f96477eb3c43e95d758a (diff) |
Fix incorrect assertions in ddt_phys_decref and ddt_sync_entry
The assertions in ddt_phys_decref and ddt_sync_entry cast ddp->ddp_refcnt
from uint64_t to int64_t, with a reference count bigger than 2^63, e.g. the
reference count of zero blocks commonly available in spare files, we may
mistakenly hit these assertations, so drop the type conversions here.
Signed-off-by: Ying Zhu <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1436
Diffstat (limited to 'module/zfs/ddt.c')
-rw-r--r-- | module/zfs/ddt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/module/zfs/ddt.c b/module/zfs/ddt.c index 2d8763a54..286f3bb60 100644 --- a/module/zfs/ddt.c +++ b/module/zfs/ddt.c @@ -324,7 +324,7 @@ void ddt_phys_decref(ddt_phys_t *ddp) { if (ddp) { - ASSERT((int64_t)ddp->ddp_refcnt > 0); + ASSERT(ddp->ddp_refcnt > 0); ddp->ddp_refcnt--; } } @@ -1058,7 +1058,6 @@ ddt_sync_entry(ddt_t *ddt, ddt_entry_t *dde, dmu_tx_t *tx, uint64_t txg) for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { ASSERT(dde->dde_lead_zio[p] == NULL); - ASSERT((int64_t)ddp->ddp_refcnt >= 0); if (ddp->ddp_phys_birth == 0) { ASSERT(ddp->ddp_refcnt == 0); continue; |