Date: Tue, 20 Aug 2013 22:31:14 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201308202231.r7KMVERi068300@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Tue Aug 20 22:31:13 2013 New Revision: 254585 URL: http://svnweb.freebsd.org/changeset/base/254585 Log: MFV r254220: Illumos ZFS issues: 4039 zfs_rename()/zfs_link() needs stronger test for XDEV Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 20 21:47:07 2013 (r254584) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 20 22:31:13 2013 (r254585) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -3727,13 +3728,18 @@ zfs_rename(vnode_t *sdvp, char *snm, vno if (VOP_REALVP(tdvp, &realvp, ct) == 0) tdvp = realvp; - if (tdvp->v_vfsp != sdvp->v_vfsp || zfsctl_is_node(tdvp)) { + tdzp = VTOZ(tdvp); + ZFS_VERIFY_ZP(tdzp); + + /* + * We check z_zfsvfs rather than v_vfsp here, because snapshots and the + * ctldir appear to have the same v_vfsp. + */ + if (tdzp->z_zfsvfs != zfsvfs || zfsctl_is_node(tdvp)) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EXDEV)); } - tdzp = VTOZ(tdvp); - ZFS_VERIFY_ZP(tdzp); if (zfsvfs->z_utf8 && u8_validate(tnm, strlen(tnm), NULL, U8_VALIDATE_ENTIRE, &error) < 0) { ZFS_EXIT(zfsvfs); @@ -4293,14 +4299,18 @@ zfs_link(vnode_t *tdvp, vnode_t *svp, ch return (SET_ERROR(EPERM)); } - if (svp->v_vfsp != tdvp->v_vfsp || zfsctl_is_node(svp)) { + szp = VTOZ(svp); + ZFS_VERIFY_ZP(szp); + + /* + * We check z_zfsvfs rather than v_vfsp here, because snapshots and the + * ctldir appear to have the same v_vfsp. + */ + if (szp->z_zfsvfs != zfsvfs || zfsctl_is_node(svp)) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EXDEV)); } - szp = VTOZ(svp); - ZFS_VERIFY_ZP(szp); - /* Prevent links to .zfs/shares files */ if ((error = sa_lookup(szp->z_sa_hdl, SA_ZPL_PARENT(zfsvfs),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308202231.r7KMVERi068300>