Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5848847ybl; Tue, 10 Dec 2019 12:30:42 -0800 (PST) X-Google-Smtp-Source: APXvYqx5Ye9/XDX7zYFqshOKd+ApwLl1yu/CA7MedtUGIMO2zYiXvKgEGEzvJYejMclWs/ZsaIw5 X-Received: by 2002:a05:6830:20cf:: with SMTP id z15mr27371832otq.277.1576009842311; Tue, 10 Dec 2019 12:30:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576009842; cv=none; d=google.com; s=arc-20160816; b=tvr06QHLK3RSk2grXZpO4eGAnJrR8NLfYkcTRCtqxcporSJCUG9rAq72HU6NdYJTHR mTWbJkxgCSKmiThvgYJSTsUYAY0Qs1JpT8CE7iLYl0Dbw3GZokD+KL9x7bUSB5J2o2dj K5yp/R31bvY+oD2XRl5P8aI9XsS0mzqKjuALuax3oRsGQ+LLUIug2CsJQ7kgcKmatQFg jIsUaojJSx++dyqLiaKghXTSs8P1pXG/Tek4VLTMyv/KynuubaBwhgKwYL61dKyP5oqj pRBshLyhqAbjVszoFnpan1VzjQLpikASCQ/Mim7QmCmtQoXREpYvkcOCmqUQmvpe18qc 7yYQ== 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=d9z0I4z27omUwUY16yCeHYxB+5qzZFnDqr3pTad5jvg=; b=FIShfbIlJ+utf4YZifb0bZ1bTBbOMy1o9pvYhczVYNXydBNWlchbIhMHvaL9NuHR/T AQ+K7Wej/bzJVunGyra5XT/M5iW9ZJ5r/6tZTQvxrMePL00gc5E/0DgM97oau1JgIvfB rUh75CJTsjAnFj1cngc0+lYmXLosFE3BaG6lVzGe+ueUea5wvZJ3ISgpjUoutptNasHT FYw5QGvFRTP/0v5w1bm/TYnMVA+kTq6s/Lhl3kLrqvBhvjBzX1bz/78ZN1YcBnF7djnb B13WSUWBKWljoznv15vIAt88/sCz6pBVbquxxV3aSrZF4Azu8VfPSuRjWFyjxddagsH/ gVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ra7wfKfo; 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 r10si2501396otn.241.2019.12.10.12.30.31; Tue, 10 Dec 2019 12:30:42 -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=Ra7wfKfo; 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 S1726500AbfLJU3q (ORCPT + 99 others); Tue, 10 Dec 2019 15:29:46 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:37188 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbfLJU3q (ORCPT ); Tue, 10 Dec 2019 15:29:46 -0500 Received: by mail-yw1-f66.google.com with SMTP id v84so1484718ywa.4 for ; Tue, 10 Dec 2019 12:29:46 -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=d9z0I4z27omUwUY16yCeHYxB+5qzZFnDqr3pTad5jvg=; b=Ra7wfKfo5lKntPVufclepjjeZyQCKXncT2TmnnGn9K0+O3KoNgaBD/B94deKEs2dBP rcfs+oki22DsEw3txRP4DKVCMKEqRcfhe3lb0uQClFdb1ExWAqqlKRcAO0R7Tinh6mIg WWBBsmllmzS/fVJhA2BIm9YtJc8zfYSlFIa2P2C+4GYyvzm4dcP7sHEN19xPG+oC9qK7 +QuIgKjTM7AM8QoZ8daVbJ0Dc4H44VWY1gctisSeKf3La1LL7XTdebJFJmcOp6GGG348 F6N/f+k9gMZ806TTrE2IQZ0xK8VAtS8kj4avQcKwoza9rs3Ell9UTQ1DoWwx5aSGpsf2 HDhA== 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=d9z0I4z27omUwUY16yCeHYxB+5qzZFnDqr3pTad5jvg=; b=TPHt3exM8stZTtez8d4JT9YNsVR4LGdTpm21ozSrdAie1FT3EZ5989Iuy4tvrT5hiM LHblneU1lMTqPwzeRS0hEoQq4/+9oxvjbCjDAE7u1R7bfC6pQRY2HqZY8DYN2mDwKM4v Xo5JewhwYCaP0Ion2U3kllJeck5kJ/YLG4oxV+4TeaKDy5/SlNnbjOIvXcIQNXg+XU+Q dL5CDmGxyMCc/1oTvRgINHWfp42IjWJ8lGzbggz8nbqa6Z4s3AhJ36mpBn+ZGGB5DFcq vSLKVnPszOEfUOpDwxEiQ27p4dP5T7XcQCMh8x5xhUcJy7FQ72MHnV6Q2/4PRpUwTi0l yTPQ== X-Gm-Message-State: APjAAAUNeMNXrXrT5mcEx25+KX26QfGRG7TZs3eHjC4mn4YIwvJihHDw g1gs5pduTcilzvqke5+3fpe1udg= X-Received: by 2002:a81:f81:: with SMTP id 123mr26137811ywp.268.1576009785702; Tue, 10 Dec 2019 12:29:45 -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 x84sm1947508ywg.47.2019.12.10.12.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 12:29:45 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: "J. Bruce Fields" Cc: Chuck Lever , linux-nfs@vger.kernel.org Subject: [PATCH 1/6] nfsd: fix filecache lookup Date: Tue, 10 Dec 2019 15:27:30 -0500 Message-Id: <20191210202735.304477-2-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191210202735.304477-1-trond.myklebust@hammerspace.com> References: <20191210202735.304477-1-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 the lookup keeps finding a nfsd_file with an unhashed open file, then retry once only. Signed-off-by: Trond Myklebust --- fs/nfsd/filecache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 32a9bf22ac08..0a3e5c2aac4b 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -789,6 +789,7 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf, *new; struct inode *inode; unsigned int hashval; + bool retry = true; /* FIXME: skip this if fh_dentry is already set? */ status = fh_verify(rqstp, fhp, S_IFREG, @@ -824,6 +825,11 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, /* Did construction of this file fail? */ if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) { + if (!retry) { + status = nfserr_jukebox; + goto out; + } + retry = false; nfsd_file_put_noref(nf); goto retry; } -- 2.23.0