FreeBSD src
Go to file
Ned Bass 36f86f73f6 Fix mismatch between SA header size and layout
When a system attribute layout is created an inconsistency may occur
between the system attribute header (sa_hdr_phys_t) size and the
variable-sized attribute count stored in the layout.  The inconsistency
results in the following failed assertion when SA_HDR_SIZE_MATCH_LAYOUT
returns false:

SPLError: 11315:0:(sa.c:1541:sa_find_idx_tab())
ASSERTION((IS_SA_BONUSTYPE(bonustype) && SA_HDR_SIZE_MATCH_LAYOUT(hdr,
tb)) || !IS_SA_BONUSTYPE(bonustype) || (IS_SA_BONUSTYPE(bonustype) &&
hdr->sa_layout_info == 0)) failed

The bug originates in this snippet from sa_find_sizes().

    if (is_var_sz && var_size > 1) {
            if (P2ROUNDUP(hdrsize + sizeof (uint16_t),
                *total < full_space) {
                    hdrsize += sizeof (uint16_t);

This assumes that the current variable-sized attribute will be stored in
the current buffer and accounts for the space needed to store its size
in the sa_hdr_phys_t. However if the next attribute spills over we need
to store a blkptr_t at the end of the bonus buffer to point to the spill
block. If the current attribute is in the way of the blkptr_t then it
too will be relocated into the spill block. But since we've already
accounted for it in the header size we get the inconsistency described
above.

To avoid this, record the index of the last variable-sized attribute
that prompted a hdrsize increase, and reverse the increase if we later
determine that that attribute will be relocated to the spill block.

Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1250
2013-01-31 10:31:19 -08:00
cmd Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
config Remove NPTL_GUARD_WITHIN_STACK 2013-01-29 10:58:20 -08:00
dracut Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
etc Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
include Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
lib Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
man Illumos #3035 LZ4 compression support in ZFS and GRUB 2013-01-29 09:28:20 -08:00
module Fix mismatch between SA header size and layout 2013-01-31 10:31:19 -08:00
patches Adding grub2 mkconfig support patch 2012-07-30 16:17:23 -07:00
scripts Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
udev Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
.gitignore Remove autotools products 2012-09-11 10:15:13 -07:00
AUTHORS Refresh AUTHORS 2012-12-19 09:47:25 -08:00
autogen.sh Remove autotools products 2012-08-27 11:47:44 -07:00
configure.ac Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
copy-builtin Consistent menuconfig name 2012-08-26 13:49:37 -07:00
COPYING Relocate COPYING+COPYRIGHT, remove README cruft 2008-12-01 15:34:53 -08:00
COPYRIGHT Update COPYRIGHT to reference zpios CDDL exceptions. 2010-05-18 14:25:28 -07:00
DISCLAIMER Update COPYRIGHT and DISCLAIMER. 2010-05-18 10:32:23 -07:00
dkms.conf.in Support building a zfs-modules-dkms sub package 2012-08-08 15:21:01 -07:00
dkms.postinst Support building a zfs-modules-dkms sub package 2012-08-08 15:21:01 -07:00
Makefile.am Do not use KERNEL_DIR env var in Makefile.am 2012-12-17 09:45:47 -08:00
META ZFS 0.6.0-rc13 2012-12-20 11:02:24 -08:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
PKGBUILD-zfs-modules.in Add make rule for building Arch Linux packages 2011-12-14 19:14:23 -08:00
PKGBUILD-zfs.in Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
README.markdown Add script for builtin module building. 2012-07-26 13:45:09 -07:00
zfs-modules.spec.in Cleanly remove zfs-modules-devel headers 2012-08-13 16:35:26 -07:00
zfs-script-config.sh.in Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
ZFS.RELEASE Update to onnv_147 2010-08-26 14:24:34 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00
zfs.spec.in Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00

Native ZFS for Linux! ZFS is an advanced file system and volume manager which was originally developed for Solaris. It has been successfully ported to FreeBSD and now there is a functional Linux ZFS kernel port too. The port currently includes a fully functional and stable SPA, DMU, and ZVOL with a ZFS Posix Layer (ZPL) on the way!

$ ./configure
$ make pkg

To copy the kernel code inside your kernel source tree for builtin compilation:

$ ./configure --enable-linux-builtin --with-linux=/usr/src/linux-...
$ ./copy-builtin /usr/src/linux-...

Full documentation for building, configuring, and using ZFS can be found at: http://zfsonlinux.org