1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the

the number of links against LINK_MAX (which is INT16_MAX), not against
UINT32_MAX.  Otherwise, the constant would implicitly be converted to
-1.

Reviewed by:	pjd
MFC after:	1 week
This commit is contained in:
Dimitry Andric 2012-01-03 20:53:07 +00:00
parent 7c864d7df9
commit a5988eb997
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229425

View File

@ -2698,7 +2698,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
links = zp->z_links + 1;
else
links = zp->z_links;
vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */
vap->va_nlink = MIN(links, LINK_MAX); /* nlink_t limit! */
vap->va_size = zp->z_size;
#ifdef sun
vap->va_rdev = vp->v_rdev;