[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190214124509.GS9224@smile.fi.intel.com>
Date: Thu, 14 Feb 2019 14:45:09 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"Tobin C . Harding" <me@...in.cc>, Joe Perches <joe@...ches.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.cz>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address
and value
On Thu, Feb 14, 2019 at 09:42:56AM +0100, Petr Mladek wrote:
> On Wed 2019-02-13 15:54:55, Andy Shevchenko wrote:
> > On Tue, Feb 12, 2019 at 04:45:30PM +0100, Petr Mladek wrote:
> > > On Fri 2019-02-08 19:27:17, Andy Shevchenko wrote:
> > > > On Fri, Feb 08, 2019 at 04:23:10PM +0100, Petr Mladek wrote:
> > > > > We are able to detect invalid values handled by %p[iI] printk specifier.
> > > > > The current error message is "invalid address". It might cause confusion
> > > > > against "(efault)" reported by the generic valid_pointer_address() check.
> > > > >
> > > > > Let's unify the style and use the more appropriate error code description
> > > > > "(einval)".
> > > >
> > > > The proper one should be "invalid address family". The proposed change
> > > > increases confusion.
> > >
> > > I am confused. Is there any error code for "invalid address family"?
> >
> > I'm not sure.
> > There is EAFNOSUPPORT. I don't know if it suits better.
>
> I would not complicate it. EAFNOSUPPORT looks too special,
> see below. Also it is controversial here because vsprintf()
> does not implement any protocol.
>
>
> > > EINVAL is standard error code used when a wrong value is passed
> > > as a parameter. In this case, the code is not able to handle
> > > the given address family.
> >
> > This is possible, but it will produce more generic message.
>
> I am not sure that I understand it. We do not pass the error code
> anywhere. The patch only changes the string that is shown instead
> of the requested value. It is a hint that something is wrong
> either with the caller or with the vsprintf() implementation.
>
> I think that it does not make sense to do a big deal from it.
> "(einval)" looks informative enough to me.
OK, let's go with it.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists