Add an assert to clarify code
The first time through the loop prevdb and prevhdl are NULL. They are then both set, but only prevdb is checked. Add an ASSERT to make it clear that prevhdl must be set when prevdb is. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Kleber <klebertarcisio@yahoo.com.br> Closes #10754 Closes #11575
This commit is contained in:
parent
f8ce8aed0c
commit
4f22619ae3
|
@ -1905,8 +1905,10 @@ zfs_obj_to_path_impl(objset_t *osp, uint64_t obj, sa_handle_t *hdl,
|
|||
size_t complen;
|
||||
int is_xattrdir;
|
||||
|
||||
if (prevdb)
|
||||
if (prevdb) {
|
||||
ASSERT(prevhdl != NULL);
|
||||
zfs_release_sa_handle(prevhdl, prevdb, FTAG);
|
||||
}
|
||||
|
||||
if ((error = zfs_obj_to_pobj(osp, sa_hdl, sa_table, &pobj,
|
||||
&is_xattrdir)) != 0)
|
||||
|
|
|
@ -2127,8 +2127,10 @@ zfs_obj_to_path_impl(objset_t *osp, uint64_t obj, sa_handle_t *hdl,
|
|||
size_t complen;
|
||||
int is_xattrdir = 0;
|
||||
|
||||
if (prevdb)
|
||||
if (prevdb) {
|
||||
ASSERT(prevhdl != NULL);
|
||||
zfs_release_sa_handle(prevhdl, prevdb, FTAG);
|
||||
}
|
||||
|
||||
if ((error = zfs_obj_to_pobj(osp, sa_hdl, sa_table, &pobj,
|
||||
&is_xattrdir)) != 0)
|
||||
|
|
Loading…
Reference in New Issue