From 36983842594c82b031baf79fa7c22eccc9fc4501 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sun, 22 Apr 2007 21:18:40 +0000 Subject: [PATCH] Fix 'zpool status -v'. To get object number we should use ZFS_DIRENT_OBJ() macro, as za_first_integer field also contains type. This should be fixed in ZFS itself, but this bug is not visible on Solaris, because there, type is not stored in za_first_integer. On the other hand it will be visible on MacOS X. Reported by: Barry Pederson --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c | 3 ++- sys/contrib/opensolaris/uts/common/fs/zfs/zap.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c index fe1294ba1b74..4246ec0b0e6c 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c @@ -48,6 +48,7 @@ #include #include #include +#include int fzap_default_block_shift = 14; /* 16k blocksize */ @@ -907,7 +908,7 @@ zap_value_search(objset_t *os, uint64_t zapobj, uint64_t value, char *name) for (zap_cursor_init(&zc, os, zapobj); (err = zap_cursor_retrieve(&zc, za)) == 0; zap_cursor_advance(&zc)) { - if (za->za_first_integer == value) { + if (ZFS_DIRENT_OBJ(za->za_first_integer) == value) { (void) strcpy(name, za->za_name); break; } diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/zap.c b/sys/contrib/opensolaris/uts/common/fs/zfs/zap.c index fe1294ba1b74..4246ec0b0e6c 100644 --- a/sys/contrib/opensolaris/uts/common/fs/zfs/zap.c +++ b/sys/contrib/opensolaris/uts/common/fs/zfs/zap.c @@ -48,6 +48,7 @@ #include #include #include +#include int fzap_default_block_shift = 14; /* 16k blocksize */ @@ -907,7 +908,7 @@ zap_value_search(objset_t *os, uint64_t zapobj, uint64_t value, char *name) for (zap_cursor_init(&zc, os, zapobj); (err = zap_cursor_retrieve(&zc, za)) == 0; zap_cursor_advance(&zc)) { - if (za->za_first_integer == value) { + if (ZFS_DIRENT_OBJ(za->za_first_integer) == value) { (void) strcpy(name, za->za_name); break; }