linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Jan Kara <jack@suse.cz>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	 lsf-pc <lsf-pc@lists.linux-foundation.org>,
	 linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] tracing the source of errors
Date: Thu, 08 Feb 2024 15:39:09 -0500	[thread overview]
Message-ID: <875xyyvggi.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20240207110041.fwypjtzsgrcdhalv@quack3> (Jan Kara's message of "Wed, 7 Feb 2024 12:00:41 +0100")

Jan Kara <jack@suse.cz> writes:

> On Wed 07-02-24 10:54:34, Miklos Szeredi via Lsf-pc wrote:
>> [I'm not planning to attend LSF this year, but I thought this topic
>> might be of interest to those who will.]
>> 
>> The errno thing is really ancient and yet quite usable.  But when
>> trying to find out where a particular EINVAL is coming from, that's
>> often mission impossible.
>> 
>> Would it make sense to add infrastructure to allow tracing the source
>> of errors?  E.g.
>> 
>> strace --errno-trace ls -l foo
>> ...
>> statx(AT_FDCWD, "foo", ...) = -1 ENOENT [fs/namei.c:1852]
>> ...
>> 
>> Don't know about others, but this issue comes up quite often for me.
>
> Yes, having this available would be really useful at times. Sometimes I
> had to resort to kprobes or good old printks.
>
>> I would implement this with macros that record the place where a
>> particular error has originated, and some way to query the last one
>> (which wouldn't be 100% accurate, but good enough I guess).
>
> The problem always has been how to implement this functionality in a
> transparent way so the code does not become a mess. So if you have some
> idea, I'd say go for it :)

I had a proposal to provide the LoC of filesystem errors as part of an
extended record of the FAN_FS_ERROR messages (fanotify interface).  It
might be a sensible interface to expose this information if not
prohibitively expensive.

One might record the position with a macro and do the fsnotify_sb_error
from a safer context.

-- 
Gabriel Krisman Bertazi

  parent reply	other threads:[~2024-02-08 20:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07  9:54 [LSF/MM/BPF TOPIC] tracing the source of errors Miklos Szeredi
2024-02-07 11:00 ` [Lsf-pc] " Jan Kara
2024-02-07 11:23   ` Miklos Szeredi
2024-02-07 12:00     ` Matthew Wilcox
2024-02-07 12:19       ` Miklos Szeredi
2024-02-08 20:47       ` Gabriel Krisman Bertazi
2024-02-07 19:29     ` Eric Sandeen
2024-02-08 20:39   ` Gabriel Krisman Bertazi [this message]
2024-02-07 17:16 ` Darrick J. Wong
2024-02-07 21:37 ` Dave Chinner
2024-02-08  9:09   ` Miklos Szeredi
2024-02-09  2:27     ` Dave Chinner
2024-02-08 15:57   ` Matthew Wilcox
2024-02-09  1:55     ` Dave Chinner

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=875xyyvggi.fsf@mailhost.krisman.be \
    --to=krisman@suse.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=miklos@szeredi.hu \
    /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).