git: 48235c377f96 - main - Fix a braino in previous.

Mateusz Guzik mjg at FreeBSD.org
Sat May 22 19:53:47 UTC 2021


The branch main has been updated by mjg:

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

commit 48235c377f960050e9129aa847d7d73019561c82
Author:     Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2021-05-22 19:48:31 +0000
Commit:     Mateusz Guzik <mjg at 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>
 


More information about the dev-commits-src-main mailing list