]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Revert "dtrace: make 'ring' and 'fill' policies imply 'noswitch' flag"
authorAndriy Gapon <avg@FreeBSD.org>
Sun, 21 Apr 2024 10:07:36 +0000 (13:07 +0300)
committerAndriy Gapon <avg@FreeBSD.org>
Sun, 21 Apr 2024 12:17:08 +0000 (15:17 +0300)
commitb9827c007a7a39c7aeef73f8efc217b7b0099464
treee443d2f6e77e2ffcabfa11400a673776ab9a0d35
parent26f6c148bce2d6734a07ea621616724f1e76e4fd
Revert "dtrace: make 'ring' and 'fill' policies imply 'noswitch' flag"

This reverts commit e92491d95ff3500e140eafa614e88ca84ffb0d26.

The general idea looked good to me.  In particular, it allowed to save
some memory and avoid memory allocation failures when a large buffer
size was requested along with ring and fill policies.

But I didn't take into account that the second, supposedly unused
buffer, was actually used as the scratch buffer.  The scratch buffer is
used as a temporary space for DTrace subroutines like copyin, copyinstr,
and alloca.

I think that the change can be fixed by allocating a separate smaller
buffer for the scratch buffer, but that fix would require more work than
I am able to do now.  Hence the revert.

Reported by: Domagoj Stolfa
Diagnosed by: Domagoj Stolfa, markj
MFC after: immediately
sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c