From: Trond Myklebust <trondmy@hammerspace.com>
To: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"Nagendra.Tomar@microsoft.com" <Nagendra.Tomar@microsoft.com>
Cc: "anna.schumaker@netapp.com" <anna.schumaker@netapp.com>
Subject: Re: [PATCH] nfs: Subsequent READDIR calls should carry non-zero cookieverifier
Date: Tue, 16 Mar 2021 13:38:36 +0000 [thread overview]
Message-ID: <309d0acaa6a40c0668429ff97096bb44f1d1ac3b.camel@hammerspace.com> (raw)
In-Reply-To: <KU1P153MB0197AE46D423F3AB32ADEF419E6B9@KU1P153MB0197.APCP153.PROD.OUTLOOK.COM>
On Tue, 2021-03-16 at 10:25 +0000, Nagendra Tomar wrote:
> From: Nagendra S Tomar <natomar@microsoft.com>
>
> If the loop in nfs_readdir_xdr_to_array() runs more than once,
> subsequent
> READDIR RPCs may wrongly carry a zero cookie verifier and non-zero
> cookie.
> Make sure subsequent calls to READDIR carry the cookie verifier
> returned
> by the first call.
>
> Signed-off-by: Nagendra S Tomar <natomar@microsoft.com>
> ---
> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> index fc4f490f2d78..08a1e2e31d0b 100644
> --- a/fs/nfs/dir.c
> +++ b/fs/nfs/dir.c
> @@ -866,6 +866,8 @@ static int nfs_readdir_xdr_to_array(struct
> nfs_readdir_descriptor *desc,
> break;
> }
>
> + verf_arg = verf_res;
> +
> status = nfs_readdir_page_filler(desc, entry, pages,
> pglen,
> arrays, narrays);
> } while (!status && nfs_readdir_page_needs_filling(page));
That looks good to me. However when looking over that code, I think I
spotted a similar issue when we're doing uncached readdir in order to
try to recover a missing cookie. I therefore Cced you on the posting
for that patch.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
prev parent reply other threads:[~2021-03-16 13:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 10:25 [PATCH] nfs: Subsequent READDIR calls should carry non-zero cookieverifier Nagendra Tomar
2021-03-16 13:38 ` Trond Myklebust [this message]
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=309d0acaa6a40c0668429ff97096bb44f1d1ac3b.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=Nagendra.Tomar@microsoft.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.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;
as well as URLs for NNTP newsgroup(s).