The branch main has been updated by mjg:

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

commit 154f0ecc10abdd3c23d233bf85e292011a130583
Author:     Mateusz Guzik <[email protected]>
AuthorDate: 2021-05-22 19:37:53 +0000
Commit:     Mateusz Guzik <[email protected]>
CommitDate: 2021-05-22 19:41:19 +0000

    Fix tinderbox build after 1762f674ccb571e6 ktrace commit.
---
 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 d9b9e1ae122b..709c1b0ff28a 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -390,7 +390,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
@@ -780,8 +782,6 @@ interpret:
                 * we do not regain any tracing during a possible block.
                 */
                setsugid(p);
-               kiop = NULL;
-
 #ifdef KTRACE
                kiop = ktrprocexec(p);
 #endif
@@ -938,7 +938,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 9e45d1820eec..7f5275cf6b28 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -2371,11 +2371,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 f1f9361f9f82..5f8a782cd7e5 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(const char *);
 void   ktrcsw(int, int, const char *);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to