View | Details | Raw Unified | Return to bug 209158 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (-9 / +15 lines)
Lines 3523-3547 zfs_rename(vnode_t *sdvp, vnode_t **svpp, struct componentname *scnp, Link Here
3523
	int		error = 0;
3523
	int		error = 0;
3524
3524
3525
	tdzp = VTOZ(tdvp);
3525
	tdzp = VTOZ(tdvp);
3526
	ZFS_VERIFY_ZP(tdzp);
3527
	zfsvfs = tdzp->z_zfsvfs;
3526
	zfsvfs = tdzp->z_zfsvfs;
3528
	ZFS_ENTER(zfsvfs);
3529
	zilog = zfsvfs->z_log;
3527
	zilog = zfsvfs->z_log;
3530
	sdzp = VTOZ(sdvp);
3528
	ZFS_ENTER(zfsvfs);
3531
3529
3530
	/*
3531
	 * We can not use ZFS_VERIFY_ZP() here because it could directly return
3532
	 * bypassing the cleanup code in the case of an error.
3533
	 */
3534
	if (tdzp->z_sa_hdl == NULL) {
3535
		error = SET_ERROR(EIO);
3536
		goto out;
3537
	}
3538
3539
	/* Reject renames across filesystems. */
3532
	if ((*svpp)->v_mount != tdvp->v_mount ||
3540
	if ((*svpp)->v_mount != tdvp->v_mount ||
3533
	    ((*tvpp) != NULL && (*svpp)->v_mount != (*tvpp)->v_mount)) {
3541
	    ((*tvpp) != NULL && (*svpp)->v_mount != (*tvpp)->v_mount)) {
3534
		error = SET_ERROR(EXDEV);
3542
		error = SET_ERROR(EXDEV);
3535
		goto out;
3543
		goto out;
3536
	}
3544
	}
3537
3545
3538
	/*
3546
	/* ZFS_VERIFY_ZP() can't be used here too. */
3539
	 * In case sdzp is not valid, let's be sure to exit from the right
3547
	sdzp = VTOZ(sdvp);
3540
	 * zfsvfs_t.
3541
	 */
3542
	if (sdzp->z_sa_hdl == NULL) {
3548
	if (sdzp->z_sa_hdl == NULL) {
3543
		ZFS_EXIT(zfsvfs);
3549
		error = SET_ERROR(EIO);
3544
		return (SET_ERROR(EIO));
3550
		goto out;
3545
	}
3551
	}
3546
3552
3547
	if (zfsctl_is_node(tdvp)) {
3553
	if (zfsctl_is_node(tdvp)) {

Return to bug 209158