* Re: [PATCH RFC v3 1/6] exterr: Introduce extended syscall error reporting
[not found] ` <877fnrn1sj.fsf-qxRn5AmX6ZD9BXuAQUXR0fooFf0ArEBIu+b9c/7xato@public.gmane.org>
@ 2015-09-15 16:35 ` Jonathan Corbet
[not found] ` <20150915103556.36b06f09-T1hC0tSOHrs@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Corbet @ 2015-09-15 16:35 UTC (permalink / raw)
To: Alexander Shishkin
Cc: Johannes Berg, Peter Zijlstra, Ingo Molnar,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, vince-yfjdyHUqu3OsTnJN9+BGXg,
eranian-hpIqsD4AKlfQT0dZR+AlfA, Arnaldo Carvalho de Melo,
linux-api-u79uwXL29TY76Z2rM5mHXA
[Rather belatedly looping in linux-api]
On Tue, 15 Sep 2015 18:24:28 +0300
Alexander Shishkin <alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
> Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> writes:
>
> > On Tue, 2015-09-15 at 17:15 +0300, Alexander Shishkin wrote:
> >>
> >> > It seems to me that current->ext_err_code needs to be cleared on
> >> > each system call entry (except for your special prctl() of
> >> > course!).
> >>
> >> I'd say, it should be up to the program to decide for how long they
> >> want to keep the extended error code around.
> >>
> >
> > I'm not convinced that works - imagine a library wanting to use the
> > prctl(), but the main application isn't doing that. Should the library
> > clear it before every call, to be sure it's not getting stale data?
> > etc.
>
> In other words, a syscall that's capable of throwing an extended error
> does clear the current::ext_err_code every time, but not other
> syscalls. Otherwise it will indeed get very confusing.
I think that anything other than the errno "grab it now or lose it"
behavior will prove confusing. I don't think there is any other way to
know that a given error report corresponds to a specific system call.
Library calls can mess it up. Kernel changes adding extended reporting to
new system calls can mess it up. Applications cannot possibly be expected
to know which system calls might change the error-reporting status, they
*have* to assume all of them will.
Or so it seems to me, anyway...
jon
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH RFC v3 1/6] exterr: Introduce extended syscall error reporting
[not found] ` <20150915103556.36b06f09-T1hC0tSOHrs@public.gmane.org>
@ 2015-09-15 17:02 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-09-15 17:02 UTC (permalink / raw)
To: Jonathan Corbet, Alexander Shishkin
Cc: Peter Zijlstra, Ingo Molnar, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
vince-yfjdyHUqu3OsTnJN9+BGXg, eranian-hpIqsD4AKlfQT0dZR+AlfA,
Arnaldo Carvalho de Melo, linux-api-u79uwXL29TY76Z2rM5mHXA
> I think that anything other than the errno "grab it now or lose it"
> behavior will prove confusing. I don't think there is any other way to
> know that a given error report corresponds to a specific system call.
> Library calls can mess it up. Kernel changes adding extended reporting to
> new system calls can mess it up. Applications cannot possibly be expected
> to know which system calls might change the error-reporting status, they
> *have* to assume all of them will.
>
Yeah I was about to say something similar - an application that expects
a certain syscall to have extended errors will get confused if running
on an older kernel where that syscall in fact does *not* have extended
errors (and thus also doesn't clear extended errors) and therefore the
extended error from a previous syscall could still be lingering on (for
example because the application didn't care to fetch it for that previo
us syscall.)
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-15 17:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1441987205-4021-1-git-send-email-alexander.shishkin@linux.intel.com>
[not found] ` <1441987205-4021-2-git-send-email-alexander.shishkin@linux.intel.com>
[not found] ` <20150914141931.39f6be92@lwn.net>
[not found] ` <87a8snn4zz.fsf@ashishki-desk.ger.corp.intel.com>
[not found] ` <1442327514.1914.31.camel@sipsolutions.net>
[not found] ` <877fnrn1sj.fsf@ashishki-desk.ger.corp.intel.com>
[not found] ` <877fnrn1sj.fsf-qxRn5AmX6ZD9BXuAQUXR0fooFf0ArEBIu+b9c/7xato@public.gmane.org>
2015-09-15 16:35 ` [PATCH RFC v3 1/6] exterr: Introduce extended syscall error reporting Jonathan Corbet
[not found] ` <20150915103556.36b06f09-T1hC0tSOHrs@public.gmane.org>
2015-09-15 17:02 ` Johannes Berg
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).