Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Dec 2020 20:25:02 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Jessica Clarke <jrtc27@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r368375 - head/sys/kern
Message-ID:  <CAGudoHG5sNLsce4vKsktEFxSEPgTMP94Q5bkwY3vRFziY6Dg9A@mail.gmail.com>
In-Reply-To: <E7D94B39-96ED-41BC-9243-2BE5DD108BAF@freebsd.org>
References:  <202012060459.0B64xO7Z064250@repo.freebsd.org> <E7D94B39-96ED-41BC-9243-2BE5DD108BAF@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the report. Fixed in r368395.

On 12/6/20, Jessica Clarke <jrtc27@freebsd.org> wrote:
> Hi Mateusz,
> This looks like a behavioural change to me. Was that intended and a bug
> fix (in which case, it should have been documented in the commit
> message) or not? See below for the exact change.
>
> On 6 Dec 2020, at 04:59, Mateusz Guzik <mjg@FreeBSD.org> wrote:
>> +static int
>> +namei_getpath(struct nameidata *ndp)
>> +{
>> +	struct componentname *cnp;
>> +	int error;
>> +
>> +	cnp = &ndp->ni_cnd;
>> +
>> +	/*
>> +	 * Get a buffer for the name to be translated, and copy the
>> +	 * name into the buffer.
>> +	 */
>> +	cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK);
>> +	if (ndp->ni_segflg == UIO_SYSSPACE) {
>> +		error = copystr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN,
>> +		    &ndp->ni_pathlen);
>> +	} else {
>> +		error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN,
>> +		    &ndp->ni_pathlen);
>> +	}
>> +
>> +	if (__predict_false(error != 0)) {
>> +		return (error);
>
> This does not call namei_cleanup_cnp.
>
>> @@ -531,31 +568,11 @@ namei(struct nameidata *ndp)
>> 	ndp->ni_lcf = 0;
>> 	ndp->ni_vp = NULL;
>>
>> -	/*
>> -	 * Get a buffer for the name to be translated, and copy the
>> -	 * name into the buffer.
>> -	 */
>> -	cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK);
>> -	if (ndp->ni_segflg == UIO_SYSSPACE)
>> -		error = copystr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN,
>> -		    &ndp->ni_pathlen);
>> -	else
>> -		error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN,
>> -		    &ndp->ni_pathlen);
>> -
>> +	error = namei_getpath(ndp);
>> 	if (__predict_false(error != 0)) {
>> -		namei_cleanup_cnp(cnp);
>
> But it used to be called in that case here.
>
>> 		return (error);
>> 	}
>
> Jess
>
>


-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHG5sNLsce4vKsktEFxSEPgTMP94Q5bkwY3vRFziY6Dg9A>