Date: Tue, 26 Sep 2017 08:45:11 +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-10@freebsd.org Subject: svn commit: r324005 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Message-ID: <201709260845.v8Q8jB2O043997@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Tue Sep 26 08:45:11 2017 New Revision: 324005 URL: https://svnweb.freebsd.org/changeset/base/324005 Log: MFC r323479,r323491: zfs: tighten debug versions of ZTOV and VTOZ Sponsored by: Panzura Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 26 08:43:43 2017 (r324004) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 26 08:45:11 2017 (r324005) @@ -227,7 +227,7 @@ ZTOV(znode_t *zp) { vnode_t *vp = zp->z_vnode; - ASSERT(vp == NULL || vp->v_data == NULL || vp->v_data == zp); + ASSERT(vp != NULL && vp->v_data == zp); return (vp); } static __inline znode_t * @@ -235,7 +235,7 @@ VTOZ(vnode_t *vp) { znode_t *zp = (znode_t *)vp->v_data; - ASSERT(zp == NULL || zp->z_vnode == NULL || zp->z_vnode == vp); + ASSERT(zp != NULL && zp->z_vnode == vp); return (zp); } #else Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Tue Sep 26 08:43:43 2017 (r324004) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Tue Sep 26 08:45:11 2017 (r324005) @@ -1612,7 +1612,10 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va boolean_t need_chmod = B_TRUE; boolean_t inherited = B_FALSE; - ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); + if ((flag & IS_ROOT_NODE) == 0) + ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); + else + ASSERT(dzp->z_vnode == NULL); bzero(acl_ids, sizeof (zfs_acl_ids_t)); acl_ids->z_mode = MAKEIMODE(vap->va_type, vap->va_mode); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 26 08:43:43 2017 (r324004) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 26 08:45:11 2017 (r324005) @@ -143,8 +143,7 @@ zfs_znode_cache_destructor(void *buf, void *arg) znode_t *zp = buf; ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - ASSERT(ZTOV(zp) == NULL); - vn_free(ZTOV(zp)); + ASSERT3P(zp->z_vnode, ==, NULL); ASSERT(!list_link_active(&zp->z_link_node)); mutex_destroy(&zp->z_acl_lock); avl_destroy(&zp->z_range_avl);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709260845.v8Q8jB2O043997>