diff options
author | Jitendra Patidar <[email protected]> | 2024-07-26 05:48:11 +0530 |
---|---|---|
committer | GitHub <[email protected]> | 2024-07-25 17:18:11 -0700 |
commit | 2ed1aebaf605ef28a0b899ec019529e0ad381d39 (patch) | |
tree | dcc1c0f23f4f5776294cb0c8b8862c902641549b /tests/runfiles | |
parent | 7ddc1f737f618a2539e06c146f9f23fa37412a91 (diff) |
Fix ZDB to dump projid for projectquota enabled (#16291)
ZDB is supposed to dump "projid" via dump_znode(), when projectquota
is enabled.
-----------
static void
dump_znode(objset_t *os, uint64_t object, void *data, size_t size)
{
...
if (dmu_objset_projectquota_enabled(os) && (pflags & ZFS_PROJID)) {
uint64_t projid;
if (sa_lookup(hdl, sa_attr_table[ZPL_PROJID], &projid,
sizeof (uint64_t)) == 0)
(void) printf("\tprojid %llu\n", (u_longlong_t)projid);
}
...
}
----------
But its not dumping "projid", even for project quota enabled.
dmu_objset_projectquota_enabled() does following 3 checks,
----------
boolean_t
dmu_objset_projectquota_enabled(objset_t *os)
{
return (file_cbs[os->os_phys->os_type] != NULL &&
DMU_PROJECTUSED_DNODE(os) != NULL &&
spa_feature_is_enabled(os->os_spa,
SPA_FEATURE_PROJECT_QUOTA));
}
----------
It fails on file_cbs[] check. file_cbs[] gets initialised via
dmu_objset_register_type(); which is not done for the ZDB, its done for
the kernel via zfs_init().
Register a dummy callback handle for the DMU_OST_ZFS type in
ZDB main() function to dump the projid for projectquota enabled.
Signed-off-by: Jitendra Patidar <[email protected]>
Closes #16290
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Diffstat (limited to 'tests/runfiles')
0 files changed, 0 insertions, 0 deletions