diff options
author | mm <mm@FreeBSD.org> | 2010-05-13 20:55:58 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2010-05-13 20:55:58 +0000 |
commit | cc11636cc42ff8dfd0229ccfea4c2c240e96f360 (patch) | |
tree | b2e5826e17eda5f7f98901d8cb711f89c39a016a /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c | |
parent | 3fb4e24eaea20e22c860c0de63f3f98c094cdf92 (diff) | |
download | FreeBSD-src-cc11636cc42ff8dfd0229ccfea4c2c240e96f360.zip FreeBSD-src-cc11636cc42ff8dfd0229ccfea4c2c240e96f360.tar.gz |
Fix ZIL-related panic on zfs rollback.
OpenSolaris onnv-revision: 8746:e1d96ca6808c
Approved by: pjd, delphij (mentor)
Obtained from: OpenSolaris (Bug ID 6796377)
MCF after: 1 week
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c index 69ad489..fe03304 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c @@ -1915,7 +1915,6 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) dnode_t *dn = db->db_dnode; objset_impl_t *os = dn->dn_objset; uint64_t txg = tx->tx_txg; - int blksz; ASSERT(dmu_tx_is_syncing(tx)); @@ -2025,23 +2024,24 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) return; } - blksz = arc_buf_size(*datap); - - if (dn->dn_object != DMU_META_DNODE_OBJECT) { + if (dn->dn_object != DMU_META_DNODE_OBJECT && + refcount_count(&db->db_holds) > 1 && + *datap == db->db_buf) { /* - * If this buffer is currently "in use" (i.e., there are - * active holds and db_data still references it), then make - * a copy before we start the write so that any modifications - * from the open txg will not leak into this write. + * If this buffer is currently "in use" (i.e., there + * are active holds and db_data still references it), + * then make a copy before we start the write so that + * any modifications from the open txg will not leak + * into this write. * - * NOTE: this copy does not need to be made for objects only - * modified in the syncing context (e.g. DNONE_DNODE blocks). + * NOTE: this copy does not need to be made for + * objects only modified in the syncing context (e.g. + * DNONE_DNODE blocks). */ - if (refcount_count(&db->db_holds) > 1 && *datap == db->db_buf) { - arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - *datap = arc_buf_alloc(os->os_spa, blksz, db, type); - bcopy(db->db.db_data, (*datap)->b_data, blksz); - } + int blksz = arc_buf_size(*datap); + arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); + *datap = arc_buf_alloc(os->os_spa, blksz, db, type); + bcopy(db->db.db_data, (*datap)->b_data, blksz); } ASSERT(*datap != NULL); |