linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 9p and EINTR?
@ 2017-03-24 21:42 Tuomas Tynkkynen
  0 siblings, 0 replies; only message in thread
From: Tuomas Tynkkynen @ 2017-03-24 21:42 UTC (permalink / raw)
  To: linux-fsdevel, v9fs-developer, linux-kernel; +Cc: Eric Van Hensbergen

Hi fsdevel,

Some users of our distro (NixOS) ran into some 9p funkiness again...
Eventually it was traced down to many 9p filesystem calls getting
interrupted by signals (here, it was bash receiving SIGCHLDs from
background jobs exiting) and returning with -EINTR. E.g. stat() manpage
doesn't list EINTR as a valid error return and bash isn't prepared
to handle that (any stat() failure when probing for a command
in PATH is treated like ENOENT).

So a quick patch like this to 9p already seemed to help (though
also a bunch of users in trans_rdma.c and trans_virtio.c
probably need similar treatment):

diff --git a/net/9p/client.c b/net/9p/client.c
index 3ce672af1596..f1c8ad373f90 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -749,8 +749,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
        }
 again:
        /* Wait for the response */
-       err = wait_event_interruptible(*req->wq,
-                                      req->status >= REQ_STATUS_RCVD);
+       err = wait_event_killable(*req->wq, req->status >= REQ_STATUS_RCVD);
 
        /*
         * Make sure our req is coherent with regard to updates in other

But I am not sure if it would be the right thing to make absolutely all
9p calls non-interruptible. So if anybody has pointers on what VFS
calls are permitted to fail with -EINTR, or what other network
filesystems do in similar situations, it would be greatly appreciated!

- Tuomas

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-24 21:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24 21:42 9p and EINTR? Tuomas Tynkkynen

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