From patchwork Fri Jan 24 09:33:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232870 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=unavailable 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 655A8C32771 for ; Fri, 24 Jan 2020 11:36:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FCF5206F0 for ; Fri, 24 Jan 2020 11:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865762; bh=fvlAEjBEWR/oecRoP9PlSXWln1msywgc0bm9ei2Y2gw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kkGJw6HAVNKWNFN7Gwr4zmsKGc5F8WMy+2Guds0BlBMHnWEh3bypdwKp/NADBvgZ6 oovdBreSh5QALXygNEP4StrcojjM4TKgefm4ay4etHvkf5obwkqBfm0Inly2XtOpnO 9x6r8p0TB/3wRoqWL/BI1qFR3QgSwupwgAY7bWMU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388491AbgAXLf5 (ORCPT ); Fri, 24 Jan 2020 06:35:57 -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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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; }