From owner-svn-src-all@FreeBSD.ORG Fri May 14 09:09:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 062D41065674; Fri, 14 May 2010 09:09:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8F9D8FC0A; Fri, 14 May 2010 09:09:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E998ae009134; Fri, 14 May 2010 09:09:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E998YB009132; Fri, 14 May 2010 09:09:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005140909.o4E998YB009132@svn.freebsd.org> From: Martin Matuska Date: Fri, 14 May 2010 09:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208065 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2010 09:09:09 -0000 Author: mm Date: Fri May 14 09:09:08 2010 New Revision: 208065 URL: http://svn.freebsd.org/changeset/base/208065 Log: MFC r207908: Fix endianess bug in ZFS intent log (ZIL). OpenSolaris onnv revision: 8109:6147a1bdd359 Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6760048) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri May 14 09:06:49 2010 (r208064) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri May 14 09:09:08 2010 (r208065) @@ -362,14 +362,20 @@ zil_create(zilog_t *zilog) blk = zh->zh_log; /* - * If we don't already have an initial log block, allocate one now. + * If we don't already have an initial log block or we have one + * but it's the wrong endianness then allocate one. */ - if (BP_IS_HOLE(&blk)) { + if (BP_IS_HOLE(&blk) || BP_SHOULD_BYTESWAP(&blk)) { tx = dmu_tx_create(zilog->zl_os); (void) dmu_tx_assign(tx, TXG_WAIT); dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx); txg = dmu_tx_get_txg(tx); + if (!BP_IS_HOLE(&blk)) { + zio_free_blk(zilog->zl_spa, &blk, txg); + BP_ZERO(&blk); + } + error = zio_alloc_blk(zilog->zl_spa, ZIL_MIN_BLKSZ, &blk, NULL, txg);