Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4130823ybl; Tue, 21 Jan 2020 13:30:14 -0800 (PST) X-Google-Smtp-Source: APXvYqx+pLd9OZMDyZnslhcS62mmdKDoA391Sq+a/GtH9Rs/BBYX6B2abRsVUw7uwCL3MMDxJNfM X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr4869798otq.1.1579642214487; Tue, 21 Jan 2020 13:30:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579642214; cv=none; d=google.com; s=arc-20160816; b=YZz4dlvezHF+VGfZ1arCzsShwDdwQANiX3JaXSk4IBOh/G6PzP4P66YVIieNDAWrgv 3I0rOzhsa9jLSKhuvFdXTutq5zpC4b/dblNKeu48XDwE17MhOaOxIGQ5BgTehPezJEsq Vdu5g/9wb01gr6sns9JGgGE9CEoH4b6IGRdGPcWxspNtBVq5+1Go4gX4KYPdOL08sDQg lcO22fJQK2+IUGx9fd7s/tBSTIEaINq9FuXVmPHu355QX5IXA5K+Tcm1A8nnr71umuwP a4VsLD185zUcKAqTb+i9t12tMA9+Y3JR5QocehelP0Dc7hXJkSkNA+2dtjFg6osoqmte n9Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=765dllpLINyVim0+8x9vhsIptdLBpO1m09QQmkSHoLQ=; b=WUtXZFupcq+HRkjMLdHzO16kiKYL6qxubanY5KB4DauQ5IhEMG7umflYU3WW9daSn2 ODHOH8Xb8tNTv4PHJiypgPUjlr3/0KGQzxgNWDLqpzGl0qbgYvahxVtfEMllGEFPYcnb J98Dh06K1EpMg2JwdKaKH1SKaIXW8pfl+agG3e9mkQe9+lfEsRVP8NoAyfhFOWz+laob SNamzH+6RHufffWOKvupN1D6oIYHMMoapbc5oJPn3Kh/OAja/gxvNM2PbfFL18Xw+uzL 35vjXdky2QIG6CfiHie+T1NhnGlbE5y0OYUwt8KgXo58BsT8xmoh3rODcFsSHu72flRL DASQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si20048685oie.196.2020.01.21.13.29.48; Tue, 21 Jan 2020 13:30:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728827AbgAUV2j (ORCPT + 99 others); Tue, 21 Jan 2020 16:28:39 -0500 Received: from fieldses.org ([173.255.197.46]:37770 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728776AbgAUV2i (ORCPT ); Tue, 21 Jan 2020 16:28:38 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 512651C84; Tue, 21 Jan 2020 16:28:38 -0500 (EST) Date: Tue, 21 Jan 2020 16:28:38 -0500 To: Trond Myklebust Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org Subject: Re: [PATCH RESEND 1/6] nfsd: fix filecache lookup Message-ID: <20200121212838.GC26055@fieldses.org> References: <20200106181808.562969-1-trond.myklebust@hammerspace.com> <20200106181808.562969-2-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200106181808.562969-2-trond.myklebust@hammerspace.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jan 06, 2020 at 01:18:03PM -0500, Trond Myklebust wrote: > If the lookup keeps finding a nfsd_file with an unhashed open file, > then retry once only. So, symptoms are a hang? Should this be cc: stable, Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd") ? --b. > > 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.24.1