[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJfpegssQ73Wv2w0F6oHm7yhUP3Q2n2vmqAPWw2E72Xa2MMSSw@mail.gmail.com>
Date: Wed, 7 Feb 2024 13:19:46 +0100
From: Miklos Szeredi <miklos@...redi.hu>
To: Matthew Wilcox <willy@...radead.org>
Cc: Jan Kara <jack@...e.cz>, lsf-pc <lsf-pc@...ts.linux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] tracing the source of errors
On Wed, 7 Feb 2024 at 13:00, Matthew Wilcox <willy@...radead.org> wrote:
> To be perfectly clear, you're suggesting two things.
>
> Option (a) change "all" code like this:
> - ret = -EINVAL;
> + ret = -ERR(EINVAL);
>
> where ERR would do some magic with __func__ and __LINE__.
>
> Option (b)
>
> -#define EINVAL 22
> +#define E_INVAL 22
> +#define EINVAL ERR(E_INVAL)
>
> and then change all code that does something like:
>
> if (err == -EINVAL)
> to
> if (err == -E_INVAL)
>
> Or have I misunderstood?
Something like that, yes.
Thanks,
Miklos
Powered by blists - more mailing lists