Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936369AbdCXVmp (ORCPT ); Fri, 24 Mar 2017 17:42:45 -0400 Received: from mx1.mpynet.fi ([82.197.21.84]:60361 "EHLO mx1.mpynet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933123AbdCXVmk (ORCPT ); Fri, 24 Mar 2017 17:42:40 -0400 Date: Fri, 24 Mar 2017 23:42:36 +0200 From: Tuomas Tynkkynen To: , , CC: Eric Van Hensbergen Subject: 9p and EINTR? Message-ID: <20170324234236.572d3576@duuni> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: tuxera-exch.ad.tuxera.com (10.20.48.11) To tuxera-exch.ad.tuxera.com (10.20.48.11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 35 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