Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1672812ybf; Sun, 1 Mar 2020 15:26:12 -0800 (PST) X-Google-Smtp-Source: ADFU+vvarSSSjwPhwkT2uL5LH/9rUOpM6f50rdjVFn0ck1gIL+fRXWKhzPObYiqiZ4u2v/ldiPLL X-Received: by 2002:a9d:5e8a:: with SMTP id f10mr3756847otl.143.1583105172455; Sun, 01 Mar 2020 15:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583105172; cv=none; d=google.com; s=arc-20160816; b=ZVMsqwIMXZMooJykgZwrLr4ojJO0y39re5jMdcNuLQ+HcI3QKQtYloIr1i1mgC0rxj ds5xaK0570NC2pPyXwXKpgM0OYbPEKh112eWiZe0yY+tN2GZQUGTXqMg2+scTYTr/Yn8 y30OfQ/enhiAaXwwQMWSoKD/DFF6qEvonZMT9lun/trMSoaMhRqd2Xpzl4ZVA3FlKXBG KCbcn8zxPBxOR4rq/x4rUstUiKnykSQdWZpMAdNLUqilf7caIwdAroZ6n3LPcdEYbzFQ MnL9VvSHk3UQOeusIpsKIPH9Y1zBYmetrS2VRqGdWQq//7HVxEBv1qGh6zh2BuDTaIt3 m3GA== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=U14Uy4stoVVLCX7z3eAHr/J7no/Y5EZ7ZoEpafZVGbk=; b=yV8NYsLGltUhDokYlOotmsVC0HWfV5JJ7Z39rfX1VfrY0Mu4xwGBOAoEbGx9mGC4Qk vz6Jd3bXKtTLO+kMeno3wpewjQtmu6zBZv8zTAXTGgOawFmgFf7wfRy6EBbpgM8jGTBC qab2oCm70VCZWcqDKLqbiAx/uCvKjFKpJDj0SxCQAeBsETFp4jbVkGAHI5gR6M0Ymb4c 6mIBMR42Ch+pnwJIQ74nfnqVO7/HDK2LrSupFVRDuPH0uh3yFMhmRqkcPkt0+cIeA53J hgnQ4jgrTDS1zXx+rAP3rHrw8GoaFkf4Uwcs2pqak14clYkkfD2NPnIAfpQVN7faH41e VHYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RuZZD6G0; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si5286665oij.38.2020.03.01.15.26.01; Sun, 01 Mar 2020 15:26:12 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RuZZD6G0; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgCAXZX (ORCPT + 99 others); Sun, 1 Mar 2020 18:25:23 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:33271 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbgCAXZW (ORCPT ); Sun, 1 Mar 2020 18:25:22 -0500 Received: by mail-yw1-f67.google.com with SMTP id j186so9530226ywe.0 for ; Sun, 01 Mar 2020 15:25:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U14Uy4stoVVLCX7z3eAHr/J7no/Y5EZ7ZoEpafZVGbk=; b=RuZZD6G0ydqhvfQDgzlWyAL3zjtZ60VfWDcCOPMuuHw7jw14D2d2wA4zcUsUjNg2DR MMecdQW74NTkV0GaX7/FfNaw3tqFvFix1rNClaUlovL57pbtxH9BYLHiC35c3gTpArNU Fy6JCyvVe/GYrfWX0yNiuW6gHA+gSW+2e+En3gqQ7iyxPM6Bmzt6azjv0nHFD5lh5iy0 nVX09fNLtKkMkvxg0fjELXh0y6bs3lDbf6lysTinIr0o9rTwsDlwAAQVd4JPPmX5EvMc WDYu251PGoxhYN//CI+LRa9fRfSzCKu8MhpErcbfisNfbqbeRQ2UIB4JnpctAvH8kiWP 2otQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U14Uy4stoVVLCX7z3eAHr/J7no/Y5EZ7ZoEpafZVGbk=; b=c/MFvCb6znjTpNX5TBm/aZhyhoP/rfSwCRorq9RUTUS9i830OlUxmOs+D8dxuE5UWB q9bqjyTeF+/fujOWFY6Yj+WRVVoFzrtyD9HKX9GKGJ3AQIDNwt6+R7fp0N/9XQbMz4fE AKSAH/JKn+uNbytP3rfesO02V7qtAyrhM5gPSCGItImXiNkp2Fms8OwQqE5rUpVeOal9 dIm93Sbdctsgg5oV+TTmQ/HULi8VcAFdQNfaAKVrhRCQQVngfkt8n/C+AeyhZhmgsFnE m6W59+/0b7Jr3EJP6hV/P0hIgtRliq2S9+n0vY8vM8GliGEa7ChpFJMkbm/kWjJWS1EV /p3Q== X-Gm-Message-State: APjAAAWF9cekg3oMwTuJxr894/ewlgsmFbS6/lgkmaWX0sJgiN7uiQGn z7T5QjzUmaMkDj3y3AY90w== X-Received: by 2002:a25:8804:: with SMTP id c4mr14255517ybl.387.1583105121539; Sun, 01 Mar 2020 15:25:21 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id u4sm7167301ywu.26.2020.03.01.15.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 15:25:21 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH 8/8] sunrpc: Drop the connection when the server drops a request Date: Sun, 1 Mar 2020 18:21:45 -0500 Message-Id: <20200301232145.1465430-9-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200301232145.1465430-8-trond.myklebust@hammerspace.com> References: <20200301232145.1465430-1-trond.myklebust@hammerspace.com> <20200301232145.1465430-2-trond.myklebust@hammerspace.com> <20200301232145.1465430-3-trond.myklebust@hammerspace.com> <20200301232145.1465430-4-trond.myklebust@hammerspace.com> <20200301232145.1465430-5-trond.myklebust@hammerspace.com> <20200301232145.1465430-6-trond.myklebust@hammerspace.com> <20200301232145.1465430-7-trond.myklebust@hammerspace.com> <20200301232145.1465430-8-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If a server wants to drop a request, then it should also drop the connection, in order to let the client know. Signed-off-by: Trond Myklebust --- net/sunrpc/svc_xprt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index de3c077733a7..83a527e56c87 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -873,6 +873,13 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) } EXPORT_SYMBOL_GPL(svc_recv); +static void svc_drop_connection(struct svc_xprt *xprt) +{ + if (test_bit(XPT_TEMP, &xprt->xpt_flags) && + !test_and_set_bit(XPT_CLOSE, &xprt->xpt_flags)) + svc_xprt_enqueue(xprt); +} + /* * Drop request */ @@ -880,6 +887,8 @@ void svc_drop(struct svc_rqst *rqstp) { trace_svc_drop(rqstp); dprintk("svc: xprt %p dropped request\n", rqstp->rq_xprt); + /* Close the connection when dropping a request */ + svc_drop_connection(rqstp->rq_xprt); svc_xprt_release(rqstp); } EXPORT_SYMBOL_GPL(svc_drop); @@ -1148,6 +1157,7 @@ static void svc_revisit(struct cache_deferred_req *dreq, int too_many) if (too_many || test_bit(XPT_DEAD, &xprt->xpt_flags)) { spin_unlock(&xprt->xpt_lock); dprintk("revisit canceled\n"); + svc_drop_connection(xprt); svc_xprt_put(xprt); trace_svc_drop_deferred(dr); kfree(dr); -- 2.24.1