NFS: Initialise the readdir verifier as best we can in nfs_opendir()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 25 Feb 2022 15:22:30 +0000 (10:22 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 28 Feb 2022 15:11:32 +0000 (10:11 -0500)
For the purpose of ensuring that opendir() followed by seekdir() work as
correctly as possible, try to initialise the readdir verifier in
nfs_opendir().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/dir.c

index 1aa55ca..1dfbd05 100644 (file)
@@ -89,6 +89,7 @@ static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir
                                                      NFS_INO_REVAL_FORCED);
                list_add(&ctx->list, &nfsi->open_files);
                clear_bit(NFS_INO_FORCE_READDIR, &nfsi->flags);
+               memcpy(ctx->verf, nfsi->cookieverf, sizeof(ctx->verf));
                spin_unlock(&dir->i_lock);
                return ctx;
        }