Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Oct 2012 18:57:27 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r241270 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201210061857.q96IvRxo020247@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Sat Oct  6 18:57:27 2012
New Revision: 241270
URL: http://svn.freebsd.org/changeset/base/241270

Log:
  MFC r240632:  zfs: correctly calculate dn_bonuslen for saving SAs to disk

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c	Sat Oct  6 18:55:54 2012	(r241269)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c	Sat Oct  6 18:57:27 2012	(r241270)
@@ -577,7 +577,7 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_
 	for (i = 0; i != attr_count; i++) {
 		boolean_t is_var_sz;
 
-		*total += attr_desc[i].sa_length;
+		*total += P2ROUNDUP(attr_desc[i].sa_length, 8);
 		if (done)
 			goto next;
 
@@ -712,6 +712,8 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu
 		length = SA_REGISTERED_LEN(sa, attrs[i]);
 		if (length == 0)
 			length = attr_desc[i].sa_length;
+		else
+			VERIFY(length == attr_desc[i].sa_length);
 
 		if (buf_space < length) {  /* switch to spill buffer */
 			VERIFY(bonustype == DMU_OT_SA);
@@ -741,6 +743,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu
 		if (sa->sa_attr_table[attrs[i]].sa_length == 0) {
 			sahdr->sa_lengths[len_idx++] = length;
 		}
+		VERIFY((uintptr_t)data_start % 8 == 0);
 		data_start = (void *)P2ROUNDUP(((uintptr_t)data_start +
 		    length), 8);
 		buf_space -= P2ROUNDUP(length, 8);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210061857.q96IvRxo020247>