freebsd-dev/lib
Zachary Bedell 7a0232735d Make libefi-created GPT compatible with gptfdisk
GPT's created by libefi set the HeaderSize attribute in the GPT
header to 512 -- size of the GPT header INCLUDING the 420 padding
bytes at the end.  Most other tools set the size to 92 -- size of
the actual header itself excluding the padding.  Most tools check
the recorded HeaderSize when verifying CRC, but gptfdisk hardcodes
92 and thus reports CRC verification problems for full-disk vdevs
created IE with `zpool create pool sdc`.

This commit changes libefi's behavior for GPT creation and also
fixes several edge cases where libefi's behavior was similar
(though in an incompatible manner) to gptfdisk.  Libefi assumed
HeaderSize was always 512 even if the GPT recorded a different
value.  Sanity checks of the GPT headersize read from disk were
added before applying checksum calculation -- this will prevent
segfault in cases of bogus on-disk values.

Zpools created with the resuling libefi are verified as correct
both by parted and gptfdisk.  Also pool have been tested to
import correctly on ZFS on Linux as well as Solaris Express 11
livecd.

Signed-off-by: Zachary Bedell <zac@thebedells.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #344
2011-09-26 09:44:43 -07:00
..
libavl Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
libefi Make libefi-created GPT compatible with gptfdisk 2011-09-26 09:44:43 -07:00
libnvpair Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
libshare Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
libspl Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
libunicode Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
libuutil Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
libzfs Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
libzpool Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00
Makefile.am Implemented sharing datasets via NFS using libshare. 2011-07-06 09:20:28 -07:00
Makefile.in Autogen refresh for udev changes 2011-08-08 16:30:27 -07:00