Date: Sun, 11 Aug 2013 01:14:46 +0000 (UTC) From: Steven Hartland <smh@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: r254203 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201308110114.r7B1EkPF075242@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: smh Date: Sun Aug 11 01:14:46 2013 New Revision: 254203 URL: http://svnweb.freebsd.org/changeset/base/254203 Log: MFC: r253926 zfs_ioc_rename should not leave the value of zc_name passed in via zc altered on return. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Aug 11 01:09:16 2013 (r254202) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Aug 11 01:14:46 2013 (r254203) @@ -3612,6 +3612,8 @@ zfs_ioc_rename(zfs_cmd_t *zc) at = strchr(zc->zc_name, '@'); if (at != NULL) { /* snaps must be in same fs */ + int error; + if (strncmp(zc->zc_name, zc->zc_value, at - zc->zc_name + 1)) return (SET_ERROR(EXDEV)); *at = '\0'; @@ -3620,14 +3622,19 @@ zfs_ioc_rename(zfs_cmd_t *zc) #else if (zc->zc_objset_type == DMU_OST_ZFS && allow_mounted) { #endif - int error = dmu_objset_find(zc->zc_name, + error = dmu_objset_find(zc->zc_name, recursive_unmount, at + 1, recursive ? DS_FIND_CHILDREN : 0); - if (error != 0) + if (error != 0) { + *at = '@'; return (error); + } } - return (dsl_dataset_rename_snapshot(zc->zc_name, - at + 1, strchr(zc->zc_value, '@') + 1, recursive)); + error = dsl_dataset_rename_snapshot(zc->zc_name, + at + 1, strchr(zc->zc_value, '@') + 1, recursive); + *at = '@'; + + return (error); } else { #ifdef illumos if (zc->zc_objset_type == DMU_OST_ZVOL)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308110114.r7B1EkPF075242>