Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1187431ybd; Wed, 26 Jun 2019 12:50:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCBGN87Bqpkbax35nGyORI/fOq5kWZeLI93TrM+x7DwCsAxqY7GQvfRlOHyOTIg7+6QUv0 X-Received: by 2002:a17:902:694a:: with SMTP id k10mr7362439plt.255.1561578639852; Wed, 26 Jun 2019 12:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561578639; cv=none; d=google.com; s=arc-20160816; b=WwVHgMRvJtgl59Rv2ooK+ZhWb/muoF1yH8qt0JSNFx+3YzkO0S/raPxpky0gmT8i3m W6pp23yt3iWB8On5rg2KOK5U/++hMWUD5lmf8yCkcpT3Az3qebd0KZw7nwHemTcOhshQ 1oj/+SJY6ZHikyHxOzj0IECipLQkJogDyLYuUWUV2e9fLu0QOi+L1awy7RBnx3/gU6zr OcInqWlPNKyWb9z9V8t0w3NuHfZeNNE5dSPcvSZnSA5xJ8Zpfi53bgNITKW/pShxfQkO 4GKuZ1/gb7hrwi4AyBIEXyneeYCtAC73cTSREf3QoAfY41pDq35LVdGNqwtT8iRk5ugD EsjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4VwnGg5HP/ojWX7rpgfqx7JqrvBLPiilQEmjEndGlZg=; b=XuWhX7JI9t2g02rMJxot+7Rmo6I9NnTjoi58kNSWmswyCMjI5tpy9BbACqtwImlcVf p69erCT+d7n16xA6TYNprWD158KEDbn6RDx6VMcmaZxJgHUxN2eZNej5aSbG4yRGjpgZ VsTYOD/G1zr9SvF0X48jn++YrhN8DHnKioc9LjJ+4E+xGbbgupntcsu2Hjs6+ESeaYTr HV7hYUZg4tcYLZc+c61yPmL2CqhfiFLT5Jefm+Ihmzeq+9RD7H1SNonaMZ+oCCeD2HUB vfiVfQ1uu5mCLfp3VJTU+3urN/Hyi0PEebbGZK9h7Ex/uPTj7jVVXHiK+PF+kF3PTHUh kqMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si15831785pgp.183.2019.06.26.12.50.15; Wed, 26 Jun 2019 12:50:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726354AbfFZTuJ (ORCPT + 99 others); Wed, 26 Jun 2019 15:50:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58614 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbfFZTuI (ORCPT ); Wed, 26 Jun 2019 15:50:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC3353081252; Wed, 26 Jun 2019 19:50:08 +0000 (UTC) Received: from dwysocha.rdu.csb (dhcp-12-212-173.gsslab.rdu.redhat.com [10.12.212.173]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 69DB15D9D6; Wed, 26 Jun 2019 19:50:07 +0000 (UTC) From: Dave Wysochanski To: trondmy@hammerspace.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH] SUNRPC: Fix possible autodisconnect during connect due to stale last_used Date: Wed, 26 Jun 2019 15:50:06 -0400 Message-Id: <1561578606-24602-1-git-send-email-dwysocha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 26 Jun 2019 19:50:08 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org When a connection is successful ensure last_used is updated before calling xprt_schedule_autodisconnect inside xprt_unlock_connect. This avoids a possible xprt_autoclose firing immediately after connect sequence due to an old value of last_used given to mod_timer in xprt_schedule_autodisconnect. Signed-off-by: Dave Wysochanski --- net/sunrpc/xprt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index f6c82b1..fceaede 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -800,6 +800,7 @@ void xprt_unlock_connect(struct rpc_xprt *xprt, void *cookie) goto out; xprt->snd_task =NULL; xprt->ops->release_xprt(xprt, NULL); + xprt->last_used = jiffies; xprt_schedule_autodisconnect(xprt); out: spin_unlock_bh(&xprt->transport_lock); -- 1.8.3.1