Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jul 2023 16:00:32 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d7614c010c76 - main - vn_path_to_global_path_hardlink(): initialize len
Message-ID:  <202307041600.364G0Wke075955@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=d7614c010c762dcb29110073e7fbecf048fa3a32

commit d7614c010c762dcb29110073e7fbecf048fa3a32
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-07-04 07:46:15 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-07-04 16:00:24 +0000

    vn_path_to_global_path_hardlink(): initialize len
    
    before calling vn_fullpath_hardlink().  Otherwise we get random failures
    when the len is automatically clipped.
    
    Reported and tested by: pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/kern/vfs_cache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 25918f5a0b6e..1310800fce4e 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -3861,6 +3861,7 @@ vn_path_to_global_path_hardlink(struct thread *td, struct vnode *vp,
 	 * name.
 	 */
 	VOP_UNLOCK(vp);
+	len = pathlen;
 	error = vn_fullpath_hardlink(vp, dvp, leaf_name, leaf_length,
 	    &rpath, &fbuf, &len);
 



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