From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755579AbdHYM1d (ORCPT ); Fri, 25 Aug 2017 08:27:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48696 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754508AbdHYM1b (ORCPT ); Fri, 25 Aug 2017 08:27:31 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7CD9881F01 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=vkuznets@redhat.com From: Vitaly Kuznetsov To: Olaf Hering Cc: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , devel@linuxdriverproject.org (open list:Hyper-V CORE AND DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH] tools: hv: handle EINTR in hv_fcopy_daemon References: <20170825110246.28397-1-olaf@aepfle.de> Date: Fri, 25 Aug 2017 14:27:27 +0200 In-Reply-To: <20170825110246.28397-1-olaf@aepfle.de> (Olaf Hering's message of "Fri, 25 Aug 2017 13:02:46 +0200") Message-ID: <87shgfessw.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 25 Aug 2017 12:27:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Olaf Hering writes: > If strace attaches to the daemon pread returns with EINTR, and the > process exits. Catch this case and continue with the next iteration. > > Signed-off-by: Olaf Hering > --- > tools/hv/hv_fcopy_daemon.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c > index c273dd34d144..574e6bf5865c 100644 > --- a/tools/hv/hv_fcopy_daemon.c > +++ b/tools/hv/hv_fcopy_daemon.c > @@ -201,6 +201,8 @@ int main(int argc, char *argv[]) > ssize_t len; > len = pread(fcopy_fd, &buffer, sizeof(buffer), 0); > if (len < 0) { > + if (errno == EINTR) > + continue; > syslog(LOG_ERR, "pread failed: %s", strerror(errno)); > exit(EXIT_FAILURE); > } Shall we request SA_RESTART with sigaction() in all three daemons instead? -- Vitaly