Author: jhb Date: Tue Dec 19 23:54:44 2017 New Revision: 327009 URL: https://svnweb.freebsd.org/changeset/base/327009
Log: Don't return early for non-failure for one of the EMLINK checks. r326987 enabled two #if 0'd-out EMLINK checks in zfs_link_create() for link overflow. However, one of the checks (when the vnode adding a link is a directory such as for mkdir) always returned even if the link did not overflow. Change this to only return early if it needs to report an EMLINK error. Reported by: db, shurd Sponsored by: Chelsio Communications Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Dec 19 23:00:08 2017 (r327008) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Dec 19 23:54:44 2017 (r327009) @@ -529,10 +529,8 @@ zfs_link_create(znode_t *dzp, const char *name, znode_ ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); #ifdef __FreeBSD__ if (zp_is_dir) { - error = 0; if (dzp->z_links >= ZFS_LINK_MAX) - error = SET_ERROR(EMLINK); - return (error); + return (SET_ERROR(EMLINK)); } #endif if (!(flag & ZRENAMING)) { _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"