linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] stat.2: Document that stat can fail with EINTR
@ 2017-12-03  0:23 Keno Fischer
  2017-12-03  2:25 ` Matthew Wilcox
  2017-12-03 16:09 ` walter harms
  0 siblings, 2 replies; 9+ messages in thread
From: Keno Fischer @ 2017-12-03  0:23 UTC (permalink / raw)
  To: linux-man; +Cc: linux-fsdevel, linux-kernel, viro, mtk.manpages, tuomas

Particularly on network file systems, a stat call may require
submitting a message over the network and waiting interruptably
for a reply.

Signed-off-by: Keno Fischer <keno@juliacomputing.com>
---

The catalyst for this patch was me experiencing EINTR errors when
using the 9p file system. In linux commit 9523feac, the 9p file
system was changed to use wait_event_killable instead of
wait_event_interruptible, which does indeed address my problem,
but also makes me a bit unhappy, because uninterruptable waits
prevents things like ^C'ing the execution and some debugging
tools which depend on being able to cancel long-running operations
by sending signals. I'd like to ask the user space applications I
care about to properly handle such situations (either by using
SA_RESTART or by explicitly handling EINTR), but it's a bit of a
hard sell if EINTR isn't documented to be a possibility. I'm hoping
this doc PATCH will generate a discussion of whether EINTR is an
appropriate thing for stat (as a stand in for a file system call that's
not read/write) to return. If so, I'd be happy to submit
patches to other file system-related syscalls along these same lines.

I realize I'm probably 20 years too late here, but it feels like
clarificaion on what to expect from the kernel would still go a long
way here.  

 man2/stat.2 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/man2/stat.2 b/man2/stat.2
index dad9a01..f10235a 100644
--- a/man2/stat.2
+++ b/man2/stat.2
@@ -452,6 +452,11 @@ Invalid flag specified in
 is relative and
 .I dirfd
 is a file descriptor referring to a file other than a directory.
+.TP
+.B EINTR
+The call was interrupted by delivery of a signal caught by a handler; see
+.BR signal (7).
+The possibility of this error is file-system dependent.
 .SH VERSIONS
 .BR fstatat ()
 was added to Linux in kernel 2.6.16;
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-19 19:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-03  0:23 [PATCH RFC] stat.2: Document that stat can fail with EINTR Keno Fischer
2017-12-03  2:25 ` Matthew Wilcox
2017-12-03  3:15   ` Keno Fischer
2017-12-04 20:58     ` Michael Kerrisk (man-pages)
2017-12-04 21:03       ` Keno Fischer
2017-12-19 13:57         ` Michael Kerrisk (man-pages)
     [not found]           ` <CABV8kRxw97+YCWuZHvcFPsUA7HbtKXjYL+0UVMqa0mC7q2RssA@mail.gmail.com>
2017-12-19 19:28             ` Michael Kerrisk (man-pages)
2017-12-04 22:31     ` Matthew Wilcox
2017-12-03 16:09 ` walter harms

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).