From: Tony Luck <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] RAS: Fix the trace_show() function to output trace_count
Date: Tue, 18 Oct 2022 07:36:53 -0700 [thread overview]
Message-ID: <Y066BV4jiRMxgjYV@agluck-desk3.sc.intel.com> (raw)
In-Reply-To: <Y02vmRn1Uz6/NMFF@zn.tnic>
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
next prev parent reply other threads:[~2022-10-18 14:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 16:16 [PATCH] RAS: Fix the trace_show() function to output trace_count Tony Luck
2022-10-05 18:17 ` Borislav Petkov
2022-10-05 19:46 ` [PATCH v2] " Tony Luck
2022-10-17 10:36 ` Borislav Petkov
2022-10-17 16:09 ` Luck, Tony
2022-10-17 19:40 ` Borislav Petkov
2022-10-18 14:36 ` Tony Luck [this message]
2022-10-18 16:05 ` Borislav Petkov
2022-10-18 16:59 ` [PATCH v3] RAS: Fix return value from show_trace() Tony Luck
2022-10-31 18:15 ` [tip: ras/core] " tip-bot2 for Tony Luck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y066BV4jiRMxgjYV@agluck-desk3.sc.intel.com \
--to=tony.luck@intel.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).