Update incorrect ddt_zap_lookup() assertion

When the ddt_zap_lookup() function was updated to dynamically
allocate memory for the cbuf variable, to save stack space, the
'csize <= sizeof (cbuf)' assertion was not updated.  The result
of this was that the size of the pointer was being used in the
comparison rather than the buffer size.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2012-07-03 14:47:57 -07:00
parent fa881d4add
commit 42d3b990cf
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ ddt_zap_lookup(objset_t *os, uint64_t object, ddt_entry_t *dde)
goto out; goto out;
ASSERT(one == 1); ASSERT(one == 1);
ASSERT(csize <= sizeof (cbuf)); ASSERT(csize <= (sizeof (dde->dde_phys) + 1));
error = zap_lookup_uint64(os, object, (uint64_t *)&dde->dde_key, error = zap_lookup_uint64(os, object, (uint64_t *)&dde->dde_key,
DDT_KEY_WORDS, 1, csize, cbuf); DDT_KEY_WORDS, 1, csize, cbuf);