Date: Fri, 14 May 2010 09:09:08 +0000 (UTC) From: Martin Matuska <mm@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r208065 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201005140909.o4E998YB009132@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005140909.o4E998YB009132>