Re: [PATCH RESEND 1/6] nfsd: fix filecache lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <trond.myklebust@xxxxxxxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux