Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1207909ybd; Wed, 26 Jun 2019 13:14:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/h49ZOthRC7I1QE5iqQM2wBdUWJM7rEk/gpc602uAFUlJhus4kfuaIdTw+1NfsSRHLTFA X-Received: by 2002:a17:902:b7c1:: with SMTP id v1mr7533066plz.85.1561580085206; Wed, 26 Jun 2019 13:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561580085; cv=none; d=google.com; s=arc-20160816; b=v4LrYDrocUApcTtfBsIWE57WFUcvn423IL2C3y1awrQi4VySqxVg4lKMxVNwC3aeVm HOdFQ8HlYat+jdvguZsXU+o0cKUI1T3aVa8y3L2EyeTj+1kVoMI3tC0ExdVTEU+8sK02 DwVxOy4AQkXwKxJVuO8u2+l1O2VBq/fC+rJzn2PSYGFfxq2CMsh+7Y82uQ8TJ7b/VQNE YizkJHyWGtFMobf7FHaiEx761nqQILmZQHwlWpyjrZ4G4STwVsB8ZfFkRBT2c5Gu2G75 WdexcpxlCNjuz/wRJOSmQy1qN6plU+nyy8q5D3vylT34CGMv33IxtxLJcgvlPn5tflqO ucFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=lplayQ4LbrkD+5GX3cmWF3TDrEYKw7GLSMUfs1+Za0I=; b=Y/J6N01vCcg4yIuymC+iT3AedaaYbr+SppptdJ7vC6GbbAYA/j81YFTbOeYri2hMdh CgSriIQTo0PUYhifXKidtR7G+l32mmaKGT0KcOFzD/h42J6ZRPXqRIEltEH8Lxg5dlEX uCotgvMordlo+TpvlRQj8v3SfjgWkS3FQQtgdG6w5FpwEs+YNiYTIMSgnFtKQA9QSE8V fiUNdoZtQGHYjY04npLlyMdmHpoKRgrLUBfkMP58I+JYaErHlrlDfYyEsTyoW7NZ9hgK BVHk79waj3b6FB9KWufyHjuZCBStC9Pz7kZv7fVVzADrB2ssLLH5atXn9OmQZ/u95Yyj rRoQ== 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 j65si84200plb.103.2019.06.26.13.14.30; Wed, 26 Jun 2019 13:14:45 -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 S1726227AbfFZUO1 (ORCPT + 99 others); Wed, 26 Jun 2019 16:14:27 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43731 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbfFZUO1 (ORCPT ); Wed, 26 Jun 2019 16:14:27 -0400 Received: by mail-qk1-f193.google.com with SMTP id m14so2771746qka.10 for ; Wed, 26 Jun 2019 13:14:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=lplayQ4LbrkD+5GX3cmWF3TDrEYKw7GLSMUfs1+Za0I=; b=EpYMGbTXH3LdI4lw4hM2CUyBrxABOV//H/PNDBEcypPIMffOTGNmK7vIzZ7qHfbyJs AFDqkisIVv1UpQIFb9V6LZ9bmzSrMA0vf46y2gHN1b9YqAvt0xpu8cEDHm1Uv0h6GmE4 b11aEVlgSSlfC6/O8z48EMtYRceu+ppMyepxuzTmN1AHb8uXBWM6LsdcklvzZHhZ9zIS Z7t0IZjrRiVpQRn3396NlvWxbCn05KSgjJ4ztXJtGd7BDfLZCCb0KNlVD2WeLo5XdozY YMVPZrSb7sqed06LJU3kriSjAQdBs+G4qA8lp1vK+UXTpTQRXlY6j8hy6OlfjYDhPki1 ZNbg== X-Gm-Message-State: APjAAAU5S0LfGgj8wOAL4vnOC2nLpNNPVvrZcUeAn1a5Z+l50q7CiNwb JNkjZVFb3jt4B+HD+bEBtqBrh6/qwHg= X-Received: by 2002:a37:c408:: with SMTP id d8mr5629215qki.18.1561580066255; Wed, 26 Jun 2019 13:14:26 -0700 (PDT) Received: from dhcp-12-212-173.gsslab.rdu.redhat.com (nat-pool-rdu-t.redhat.com. [66.187.233.202]) by smtp.gmail.com with ESMTPSA id d141sm8827863qke.3.2019.06.26.13.14.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2019 13:14:25 -0700 (PDT) Message-ID: <2b8a79f46c23e40c8bf60de4aaf37bd140c3f069.camel@redhat.com> Subject: Re: [PATCH] SUNRPC: Fix possible autodisconnect during connect due to stale last_used From: Dave Wysochanski To: Trond Myklebust Cc: "linux-nfs@vger.kernel.org" Date: Wed, 26 Jun 2019 16:14:24 -0400 In-Reply-To: <566e3eb7b501d48a2989461c316b66c03c56b129.camel@hammerspace.com> References: <1561578606-24602-1-git-send-email-dwysocha@redhat.com> <566e3eb7b501d48a2989461c316b66c03c56b129.camel@hammerspace.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 2019-06-26 at 20:11 +0000, Trond Myklebust wrote: > On Wed, 2019-06-26 at 15:50 -0400, Dave Wysochanski wrote: > > 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); > > Let's just move that line into xprt_schedule_autodisconnect(), since > in > practice this means all callers are doing the same thing. > > Will do and resubmit - thanks!