Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 May 2021 19:53:47 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 48235c377f96 - main - Fix a braino in previous.
Message-ID:  <202105221953.14MJrlx7026358@gitrepo.freebsd.org>

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

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

commit 48235c377f960050e9129aa847d7d73019561c82
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-05-22 19:48:31 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-05-22 19:53:40 +0000

    Fix a braino in previous.
    
    Instead of trying to partially ifdef out ktrace handling, define the
    missing identifier to 0. Without this fix lack of ktrace in the kernel
    also means there is no SIGXFSZ signal delivery.
---
 sys/kern/vfs_vnops.c | 2 --
 sys/sys/ktrace.h     | 4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 7f5275cf6b28..9e45d1820eec 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -2371,13 +2371,11 @@ 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 5f8a782cd7e5..283a95c36d6c 100644
--- a/sys/sys/ktrace.h
+++ b/sys/sys/ktrace.h
@@ -308,8 +308,12 @@ void	ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *,
 #define ktrstat_error(s, error) \
 	ktrstruct_error("stat", (s), sizeof(struct stat), error)
 extern u_int ktr_geniosize;
+#ifdef	KTRACE
 extern int ktr_filesize_limit_signal;
 #else
+#define	ktr_filesize_limit_signal 0
+#endif
+#else
 
 #include <sys/cdefs.h>
 



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