Illumos #xxx: zdb -vvv broken after zfs diff integration

References to Illumos issue and patch:
- https://github.com/illumos/illumos-gate/commit/163eb7ff

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #340
This commit is contained in:
Tim Haley 2011-07-26 16:38:27 -07:00 committed by Brian Behlendorf
parent bfb73f9277
commit 7b8518cb8d

View File

@ -1560,12 +1560,12 @@ zfs_sa_setup(objset_t *osp, sa_attr_type_t **sa_table)
static int static int
zfs_grab_sa_handle(objset_t *osp, uint64_t obj, sa_handle_t **hdlp, zfs_grab_sa_handle(objset_t *osp, uint64_t obj, sa_handle_t **hdlp,
dmu_buf_t **db) dmu_buf_t **db, void *tag)
{ {
dmu_object_info_t doi; dmu_object_info_t doi;
int error; int error;
if ((error = sa_buf_hold(osp, obj, FTAG, db)) != 0) if ((error = sa_buf_hold(osp, obj, tag, db)) != 0)
return (error); return (error);
dmu_object_info_from_db(*db, &doi); dmu_object_info_from_db(*db, &doi);
@ -1573,13 +1573,13 @@ zfs_grab_sa_handle(objset_t *osp, uint64_t obj, sa_handle_t **hdlp,
doi.doi_bonus_type != DMU_OT_ZNODE) || doi.doi_bonus_type != DMU_OT_ZNODE) ||
(doi.doi_bonus_type == DMU_OT_ZNODE && (doi.doi_bonus_type == DMU_OT_ZNODE &&
doi.doi_bonus_size < sizeof (znode_phys_t))) { doi.doi_bonus_size < sizeof (znode_phys_t))) {
sa_buf_rele(*db, FTAG); sa_buf_rele(*db, tag);
return (ENOTSUP); return (ENOTSUP);
} }
error = sa_handle_get(osp, obj, NULL, SA_HDL_PRIVATE, hdlp); error = sa_handle_get(osp, obj, NULL, SA_HDL_PRIVATE, hdlp);
if (error != 0) { if (error != 0) {
sa_buf_rele(*db, FTAG); sa_buf_rele(*db, tag);
return (error); return (error);
} }
@ -1587,10 +1587,10 @@ zfs_grab_sa_handle(objset_t *osp, uint64_t obj, sa_handle_t **hdlp,
} }
void void
zfs_release_sa_handle(sa_handle_t *hdl, dmu_buf_t *db) zfs_release_sa_handle(sa_handle_t *hdl, dmu_buf_t *db, void *tag)
{ {
sa_handle_destroy(hdl); sa_handle_destroy(hdl);
sa_buf_rele(db, FTAG); sa_buf_rele(db, tag);
} }
/* /*
@ -1667,7 +1667,7 @@ zfs_obj_to_path_impl(objset_t *osp, uint64_t obj, sa_handle_t *hdl,
int is_xattrdir; int is_xattrdir;
if (prevdb) if (prevdb)
zfs_release_sa_handle(prevhdl, prevdb); zfs_release_sa_handle(prevhdl, prevdb, FTAG);
if ((error = zfs_obj_to_pobj(sa_hdl, sa_table, &pobj, if ((error = zfs_obj_to_pobj(sa_hdl, sa_table, &pobj,
&is_xattrdir)) != 0) &is_xattrdir)) != 0)
@ -1699,7 +1699,7 @@ zfs_obj_to_path_impl(objset_t *osp, uint64_t obj, sa_handle_t *hdl,
prevhdl = sa_hdl; prevhdl = sa_hdl;
prevdb = sa_db; prevdb = sa_db;
} }
error = zfs_grab_sa_handle(osp, obj, &sa_hdl, &sa_db); error = zfs_grab_sa_handle(osp, obj, &sa_hdl, &sa_db, FTAG);
if (error != 0) { if (error != 0) {
sa_hdl = prevhdl; sa_hdl = prevhdl;
sa_db = prevdb; sa_db = prevdb;
@ -1709,7 +1709,7 @@ zfs_obj_to_path_impl(objset_t *osp, uint64_t obj, sa_handle_t *hdl,
if (sa_hdl != NULL && sa_hdl != hdl) { if (sa_hdl != NULL && sa_hdl != hdl) {
ASSERT(sa_db != NULL); ASSERT(sa_db != NULL);
zfs_release_sa_handle(sa_hdl, sa_db); zfs_release_sa_handle(sa_hdl, sa_db, FTAG);
} }
if (error == 0) if (error == 0)
@ -1730,13 +1730,13 @@ zfs_obj_to_path(objset_t *osp, uint64_t obj, char *buf, int len)
if (error != 0) if (error != 0)
return (error); return (error);
error = zfs_grab_sa_handle(osp, obj, &hdl, &db); error = zfs_grab_sa_handle(osp, obj, &hdl, &db, FTAG);
if (error != 0) if (error != 0)
return (error); return (error);
error = zfs_obj_to_path_impl(osp, obj, hdl, sa_table, buf, len); error = zfs_obj_to_path_impl(osp, obj, hdl, sa_table, buf, len);
zfs_release_sa_handle(hdl, db); zfs_release_sa_handle(hdl, db, FTAG);
return (error); return (error);
} }
@ -1756,19 +1756,19 @@ zfs_obj_to_stats(objset_t *osp, uint64_t obj, zfs_stat_t *sb,
if (error != 0) if (error != 0)
return (error); return (error);
error = zfs_grab_sa_handle(osp, obj, &hdl, &db); error = zfs_grab_sa_handle(osp, obj, &hdl, &db, FTAG);
if (error != 0) if (error != 0)
return (error); return (error);
error = zfs_obj_to_stats_impl(hdl, sa_table, sb); error = zfs_obj_to_stats_impl(hdl, sa_table, sb);
if (error != 0) { if (error != 0) {
zfs_release_sa_handle(hdl, db); zfs_release_sa_handle(hdl, db, FTAG);
return (error); return (error);
} }
error = zfs_obj_to_path_impl(osp, obj, hdl, sa_table, buf, len); error = zfs_obj_to_path_impl(osp, obj, hdl, sa_table, buf, len);
zfs_release_sa_handle(hdl, db); zfs_release_sa_handle(hdl, db, FTAG);
return (error); return (error);
} }