Hi,

I'm working on a project to emulate hostids in non-global zones.  Part 
of my solution touches uts/common/fs/zfs/spa.c and spa_config.c where 
the hostid stored in a storage pool is compared to the local system's 
hostid (spa.c:1162-1182) and the local system's hostid is stored in a 
storage pool's configuration (spa_config.c:352-356).  I have two 
questions about this code:

(1)  Why does 0 signify an invalid or nonexistent hostid?  Why not 
FFFFFFFF, which userland understands to be an invalid hostid (see 
gethostid() in libc/port/gen/gethostid.c)?

(2)  Why is is that if the local system's hostid is invalid (0), then 
the system can import zpools accessed by other hosts?  (That's what the 
code block in spa.c does.)  Shouldn't it rather be the case that if the 
local system's hostid is invalid, then the system shouldn't be able to 
import any zpools?

Thank you for your time.

Regards,
Jordan

-- 
/*
  * Jordan Vaughan
  * Solaris Kernel Developer
  * Jordan.Vaughan at Sun.com
  * blogs.sun.com/lunchware
  */

Reply via email to