]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing: Have the error of __tracing_resize_ring_buffer() passed to user
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 13 Feb 2025 18:41:32 +0000 (13:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:30:16 +0000 (04:30 -0800)
commit1e6419b1a41da83ed63b98c40e5f4f3781fedd48
treec2729c771985a20eac5af8770792569542f2b969
parent3284fbfa87115f4295c9a9edd2a4d02b337fd2ca
tracing: Have the error of __tracing_resize_ring_buffer() passed to user

[ Upstream commit 60b8f711143de7cd9c0f55be0fe7eb94b19eb5c7 ]

Currently if __tracing_resize_ring_buffer() returns an error, the
tracing_resize_ringbuffer() returns -ENOMEM. But it may not be a memory
issue that caused the function to fail. If the ring buffer is memory
mapped, then the resizing of the ring buffer will be disabled. But if the
user tries to resize the buffer, it will get an -ENOMEM returned, which is
confusing because there is plenty of memory. The actual error returned was
-EBUSY, which would make much more sense to the user.

Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Vincent Donnefort <vdonnefort@google.com>
Link: https://lore.kernel.org/20250213134132.7e4505d7@gandalf.local.home
Fixes: 117c39200d9d7 ("ring-buffer: Introducing ring-buffer mapping functions")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/trace.c