public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: bfields@fieldses.org (J. Bruce Fields)
To: trondmy@kernel.org
Cc: "J. Bruce Fields" <bfields@redhat.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd: Don't keep looking up unhashed files in the nfsd file cache
Date: Wed, 24 Feb 2021 15:59:37 -0500	[thread overview]
Message-ID: <20210224205937.GH11591@fieldses.org> (raw)
In-Reply-To: <20210219020207.688592-1-trondmy@kernel.org>

On Thu, Feb 18, 2021 at 09:02:07PM -0500, trondmy@kernel.org wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> If a file is unhashed, then we're going to reject it anyway and retry,
> so make sure we skip it when we're doing the RCU lockless lookup.
> This avoids a number of unnecessary nfserr_jukebox returns from
> nfsd_file_acquire()

Looks good to me.--b.

> 
> Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd")
> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> ---
>  fs/nfsd/filecache.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index 53fcbf79bdca..7629248fdd53 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -898,6 +898,8 @@ nfsd_file_find_locked(struct inode *inode, unsigned int may_flags,
>  			continue;
>  		if (!nfsd_match_cred(nf->nf_cred, current_cred()))
>  			continue;
> +		if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags))
> +			continue;
>  		if (nfsd_file_get(nf) != NULL)
>  			return nf;
>  	}
> -- 
> 2.29.2

  reply	other threads:[~2021-02-24 21:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19  2:02 [PATCH] nfsd: Don't keep looking up unhashed files in the nfsd file cache trondmy
2021-02-24 20:59 ` J. Bruce Fields [this message]
2021-02-24 21:01   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210224205937.GH11591@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=bfields@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox