Date: Mon, 25 May 2015 11:33:57 +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: r283521 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201505251133.t4PBXvYG073808@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Mon May 25 11:33:57 2015 New Revision: 283521 URL: https://svnweb.freebsd.org/changeset/base/283521 Log: MFC r282473: dmu_recv_end_check: don't leak hold if dsl_destroy_snapshot_check_impl fails Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.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/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:33:45 2015 (r283520) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:33:57 2015 (r283521) @@ -1755,7 +1755,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); if (error != 0) - return (error); + break; if (snap->ds_dir != origin_head->ds_dir) error = SET_ERROR(EINVAL); if (error == 0) { @@ -1765,7 +1765,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * obj = snap->ds_phys->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) - return (error); + break; + } + if (error != 0) { + dsl_dataset_rele(origin_head, FTAG); + return (error); } } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505251133.t4PBXvYG073808>