Date: Fri, 22 May 2020 11:53:08 +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-12@freebsd.org Subject: svn commit: r361366 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <202005221153.04MBr88I027387@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Fri May 22 11:53:07 2020 New Revision: 361366 URL: https://svnweb.freebsd.org/changeset/base/361366 Log: MFC r358381: use ZFS_MAX_DATASET_NAME_LEN instead of MAXPATHLEN for dataset names The change affects only FreeBSD specific code as the common code already mostly uses the more idiomatic and correct ZFS_MAX_DATASET_NAME_LEN. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 22 11:41:08 2020 (r361365) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 22 11:53:07 2020 (r361366) @@ -2528,16 +2528,16 @@ dsl_dataset_rename_snapshot_sync_impl(dsl_pool_t *dp, #ifdef __FreeBSD__ #ifdef _KERNEL - oldname = kmem_alloc(MAXPATHLEN, KM_SLEEP); - newname = kmem_alloc(MAXPATHLEN, KM_SLEEP); - snprintf(oldname, MAXPATHLEN, "%s@%s", ddrsa->ddrsa_fsname, - ddrsa->ddrsa_oldsnapname); - snprintf(newname, MAXPATHLEN, "%s@%s", ddrsa->ddrsa_fsname, - ddrsa->ddrsa_newsnapname); + oldname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + newname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + snprintf(oldname, ZFS_MAX_DATASET_NAME_LEN, "%s@%s", + ddrsa->ddrsa_fsname, ddrsa->ddrsa_oldsnapname); + snprintf(newname, ZFS_MAX_DATASET_NAME_LEN, "%s@%s", + ddrsa->ddrsa_fsname, ddrsa->ddrsa_newsnapname); zfsvfs_update_fromname(oldname, newname); zvol_rename_minors(oldname, newname); - kmem_free(newname, MAXPATHLEN); - kmem_free(oldname, MAXPATHLEN); + kmem_free(newname, ZFS_MAX_DATASET_NAME_LEN); + kmem_free(oldname, ZFS_MAX_DATASET_NAME_LEN); #endif #endif dsl_dataset_rele(ds, FTAG); @@ -3090,8 +3090,8 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx) /* Take the spa_namespace_lock early so zvol renames don't deadlock. */ mutex_enter(&spa_namespace_lock); - oldname = kmem_alloc(MAXPATHLEN, KM_SLEEP); - newname = kmem_alloc(MAXPATHLEN, KM_SLEEP); + oldname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + newname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); #endif /* move snapshots to this dir */ @@ -3179,8 +3179,8 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx) #if defined(__FreeBSD__) && defined(_KERNEL) mutex_exit(&spa_namespace_lock); - kmem_free(newname, MAXPATHLEN); - kmem_free(oldname, MAXPATHLEN); + kmem_free(newname, ZFS_MAX_DATASET_NAME_LEN); + kmem_free(oldname, ZFS_MAX_DATASET_NAME_LEN); #endif /* * Change space accounting.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005221153.04MBr88I027387>