diff options
author | delphij <delphij@FreeBSD.org> | 2009-12-19 11:49:20 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-12-19 11:49:20 +0000 |
commit | b2e3b6afad694dc1a202ebbdd9ae7ae0af2e914d (patch) | |
tree | 7329f9662c0daa3cc833054aa27f7df7589c50c9 /sys/cddl/contrib | |
parent | 9d17dfcbc83b14e24815623f6a321735df30fed5 (diff) | |
download | FreeBSD-src-b2e3b6afad694dc1a202ebbdd9ae7ae0af2e914d.zip FreeBSD-src-b2e3b6afad694dc1a202ebbdd9ae7ae0af2e914d.tar.gz |
Apply fix for Solaris bug 6462803: zfs snapshot -r failed because
filesystem was busy
(onnv revision 8989)
Submitted by: mm
Approved by: pjd
Obtained from: OpenSolaris
MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/contrib')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c index 2e85c52..9803265 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c @@ -828,6 +828,7 @@ restore_object(struct restorearg *ra, objset_t *os, struct drr_object *drro) { int err; dmu_tx_t *tx; + void *data = NULL; if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || @@ -869,6 +870,12 @@ restore_object(struct restorearg *ra, objset_t *os, struct drr_object *drro) if (err) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); @@ -880,18 +887,13 @@ restore_object(struct restorearg *ra, objset_t *os, struct drr_object *drro) dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); dmu_object_set_compress(os, drro->drr_object, drro->drr_compress, tx); - if (drro->drr_bonuslen) { + if (data != NULL) { dmu_buf_t *db; - void *data; + VERIFY(0 == dmu_bonus_hold(os, drro->drr_object, FTAG, &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (data == NULL) { - dmu_tx_commit(tx); - return (ra->err); - } bcopy(data, db->db_data, drro->drr_bonuslen); if (ra->byteswap) { dmu_ot[drro->drr_bonustype].ot_byteswap(db->db_data, |