If the lookup keeps finding a nfsd_file with an unhashed open file,
then retry once only.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org
Fixes: 65294c1f2c5e "nfsd: add a new struct file caching facility to nfsd"
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
        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,
 
        /* 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;
        }