From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0975BC2D0DB for ; Fri, 24 Jan 2020 11:36:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6E73206F0 for ; Fri, 24 Jan 2020 11:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865760; bh=fvlAEjBEWR/oecRoP9PlSXWln1msywgc0bm9ei2Y2gw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XUtclSeZz0Vvx1e1DRvZR0hTDJTDUIRdN1c6NE+ZHbfMGsEzliNL2D5qZBvUWqeyJ M0JouUnsnF7eltU8E86yq65hOYDBZkvu845JPQVNlCq2FUNSqY4DU1cyvJKiv4pNrR ovGNpwnIoJJ1anQ4giELokVC/kDClcNy8CvTHXkU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391933AbgAXLf7 (ORCPT ); Fri, 24 Jan 2020 06:35:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:56044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387523AbgAXLf4 (ORCPT ); Fri, 24 Jan 2020 06:35:56 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CF01D22464; Fri, 24 Jan 2020 11:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865755; bh=fvlAEjBEWR/oecRoP9PlSXWln1msywgc0bm9ei2Y2gw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LYeCNU6L/no465kAWp7hU3ZmM7FRGfDQ43P0mtnOY0vNZ9szK0EKxBS713hxUIJ4Q cLAQeUH2BdlHtfmRKgja4GQBSQRypoKq9rOwYqYXkEKlPWbBAtpxMAT0pN6yg65GcE +v8GzTtGbkmmN6OB2rNsNyzr5SGWeLQGWUuk0LkE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Marc Dionne , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 613/639] afs: Fix missing timeout reset Date: Fri, 24 Jan 2020 10:33:03 +0100 Message-Id: <20200124093206.260681306@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells [ Upstream commit c74386d50fbaf4a54fd3fe560f1abc709c0cff4b ] In afs_wait_for_call_to_complete(), rather than immediately aborting an operation if a signal occurs, the code attempts to wait for it to complete, using a schedule timeout of 2*RTT (or min 2 jiffies) and a check that we're still receiving relevant packets from the server before we consider aborting the call. We may even ping the server to check on the status of the call. However, there's a missing timeout reset in the event that we do actually get a packet to process, such that if we then get a couple of short stalls, we then time out when progress is actually being made. Fix this by resetting the timeout any time we get something to process. If it's the failure of the call then the call state will get changed and we'll exit the loop shortly thereafter. A symptom of this is data fetches and stores failing with EINTR when they really shouldn't. Fixes: bc5e3a546d55 ("rxrpc: Use MSG_WAITALL to tell sendmsg() to temporarily ignore signals") Signed-off-by: David Howells Reviewed-by: Marc Dionne Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/afs/rxrpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index 2543f24d23f8d..560dd5ff5a151 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -573,6 +573,7 @@ static long afs_wait_for_call_to_complete(struct afs_call *call, call->need_attention = false; __set_current_state(TASK_RUNNING); afs_deliver_to_call(call); + timeout = rtt2; continue; } -- 2.20.1