mirror_zfs/cmd
Jitendra Patidar 2ed1aebaf6
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 <jitendra.patidar@nutanix.com>
Closes #16290
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
2024-07-25 17:18:11 -07:00
..
raidz_test RAID-Z expansion feature 2023-11-08 10:19:41 -08:00
zdb Fix ZDB to dump projid for projectquota enabled (#16291) 2024-07-25 17:18:11 -07:00
zed zed: Add deadman-slot_off.sh zedlet 2024-05-29 10:46:41 -07:00
zfs Better control the thread pool size when mounting datasets 2024-05-14 09:36:21 -07:00
zinject Parallel pool import 2024-04-22 09:42:38 -07:00
zpool zpool import output is not formated properly. 2024-05-29 13:34:59 -07:00
zpool_influxdb Do not report bytes skipped by scan as issued. 2023-06-30 08:47:13 -07:00
zstream Use memset to zero stack allocations containing unions 2024-05-24 19:00:29 -07:00
arc_summary Speculative prefetch for reordered requests 2024-04-08 15:13:27 -07:00
arcstat.in Fix arcstats for FreeBSD after zfetch support 2024-04-29 13:28:50 -07:00
dbufstat.in Consider dnode_t allocations in dbuf cache size accounting 2023-11-17 13:25:53 -08:00
fsck.zfs.in cmd: move single-file binaries up, extract udev programs to udev/ 2022-05-10 10:20:34 -07:00
Makefile.am config: use -Wno-format-truncation globally 2024-02-26 12:23:55 -08:00
mount_zfs.c nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
zfs_ids_to_path.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zgenhostid.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zhack.c Provide macros for setting and getting blkptr birth times 2024-03-25 15:01:54 -07:00
zilstat.in zil: add stats for commit failure/fallback (#16315) 2024-07-25 16:53:59 -07:00
ztest.c ddt: dedup table quota enforcement 2024-07-25 09:47:36 -07:00
zvol_wait zvol_wait logic may terminate prematurely 2022-10-11 12:12:04 -07:00