[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y066BV4jiRMxgjYV@agluck-desk3.sc.intel.com>
Date: Tue, 18 Oct 2022 07:36:53 -0700
From: Tony Luck <tony.luck@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: "x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] RAS: Fix the trace_show() function to output
trace_count
On Mon, Oct 17, 2022 at 09:40:09PM +0200, Borislav Petkov wrote:
> Question is, what is your goal with this?
I ran into it while fixing:
https://lore.kernel.org/all/20221006163258.318916-1-tony.luck@intel.com/
when I just used "cat daemon_active" to check status and was confused
by the lack of any output. Looked at the code and saw the silly
return atomic_read(&trace_count);
which does nothing useful.
Maybe if there isn't a reasonable thing to output, that could be
changed to:
static int trace_show(struct seq_file *m, void *v)
{
/*
* User should use "lsof daemon_active" if they want to
* know if there is a process consuming trace error records
*/
return 0;
}
Sadly, we need to have a trace_show() function. If trace_open() just
does:
return single_open(file, NULL, NULL);
then we get a deref NULL OOPs if somebody does "cat daemon_active" :-(
-Tony
Powered by blists - more mailing lists