]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
simplify path handling in sysctl_try_reclaim_vnode
authoremaste <emaste@FreeBSD.org>
Wed, 2 Oct 2019 21:01:23 +0000 (21:01 +0000)
committeremaste <emaste@FreeBSD.org>
Wed, 2 Oct 2019 21:01:23 +0000 (21:01 +0000)
commit3913895c3d89bdae0eb1c446b01d21dd2e8e73a2
tree558adbcc7fc26cc5fecce1f205924bceaa05eb7c
parent36efb7f9b7a154e1f0405140c673ad9cd03f2f6c
simplify path handling in sysctl_try_reclaim_vnode

MAXPATHLEN / PATH_MAX includes space for the terminating NUL, and namei
verifies the presence of the NUL.  Thus there is no need to increase the
buffer size here.

The sysctl passes the string excluding the NUL, so req->newlen equal to
PATH_MAX is too long.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21876
sys/kern/vfs_subr.c