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 <bp@barryp.org>
This commit is contained in:
pjd 2007-04-22 21:18:40 +00:00
parent 6af3e59793
commit 328ad8c39b
2 changed files with 4 additions and 2 deletions

View File

@ -48,6 +48,7 @@
#include <sys/refcount.h>
#include <sys/zap_impl.h>
#include <sys/zap_leaf.h>
#include <sys/zfs_znode.h>
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;
}

View File

@ -48,6 +48,7 @@
#include <sys/refcount.h>
#include <sys/zap_impl.h>
#include <sys/zap_leaf.h>
#include <sys/zfs_znode.h>
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;
}