Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jun 2021 01:45:07 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c1cbdaa22a33 - stable/13 - Fix tinderbox build after 1762f674ccb571e6 ktrace commit.
Message-ID:  <202106130145.15D1j7Wl051958@gitrepo.freebsd.org>

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

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

commit c1cbdaa22a3377715afd271df4fb5acdeab4bead
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-05-22 19:37:53 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-06-13 01:22:33 +0000

    Fix tinderbox build after 1762f674ccb571e6 ktrace commit.
    
    (cherry picked from commit 154f0ecc10abdd3c23d233bf85e292011a130583)
---
 sys/kern/kern_exec.c | 6 ++++--
 sys/kern/vfs_vnops.c | 2 ++
 sys/sys/ktrace.h     | 9 +++++++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 2936e246f706..01ec7de5d3c1 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -398,7 +398,9 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p,
 	static const char fexecv_proc_title[] = "(fexecv)";
 
 	imgp = &image_params;
+#ifdef KTRACE
 	kiop = NULL;
+#endif
 
 	/*
 	 * Lock the process and set the P_INEXEC flag to indicate that
@@ -788,8 +790,6 @@ interpret:
 		 * we do not regain any tracing during a possible block.
 		 */
 		setsugid(p);
-		kiop = NULL;
-
 #ifdef KTRACE
 		kiop = ktrprocexec(p);
 #endif
@@ -946,7 +946,9 @@ exec_fail:
 	 */
 	if (oldtextvp != NULL)
 		vrele(oldtextvp);
+#ifdef KTRACE
 	ktr_io_params_free(kiop);
+#endif
 	pargs_drop(oldargs);
 	pargs_drop(newargs);
 	if (oldsigacts != NULL)
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 9c3d261a25c4..95b6821bdff5 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -2372,11 +2372,13 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio,
 	if ((uoff_t)uio->uio_offset + uio->uio_resid < lim)
 		return (0);
 
+#ifdef KTRACE
 	if (!ktr_write || ktr_filesize_limit_signal) {
 		PROC_LOCK(td->td_proc);
 		kern_psignal(td->td_proc, SIGXFSZ);
 		PROC_UNLOCK(td->td_proc);
 	}
+#endif
 	return (EFBIG);
 }
 
diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h
index 50030d002f97..1fcac8e0cd26 100644
--- a/sys/sys/ktrace.h
+++ b/sys/sys/ktrace.h
@@ -267,7 +267,16 @@ struct ktr_struct_array {
 #ifdef	_KERNEL
 struct ktr_io_params;
 
+#ifdef	KTRACE
 struct vnode *ktr_get_tracevp(struct proc *, bool);
+#else
+static inline struct vnode *
+ktr_get_tracevp(struct proc *p, bool ref)
+{
+
+	return (NULL);
+}
+#endif
 void	ktr_io_params_free(struct ktr_io_params *);
 void	ktrnamei(char *);
 void	ktrcsw(int, int, const char *);



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