linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fields Bruce James <bfields@fieldses.org>
To: Trond Myklebust <trondmy@primarydata.com>
Cc: Coddington Benjamin <bcodding@redhat.com>,
	List Linux NFS Mailing <linux-nfs@vger.kernel.org>
Subject: Re: I can't get no readdir satisfaction
Date: Wed, 24 Aug 2016 11:16:20 -0400	[thread overview]
Message-ID: <20160824151620.GJ3938@fieldses.org> (raw)
In-Reply-To: <A52A7ED8-D2B6-424D-87FE-9F77C14BEC93@primarydata.com>

On Wed, Aug 24, 2016 at 02:53:10PM +0000, Trond Myklebust wrote:
> 
> > On Aug 24, 2016, at 10:40, J. Bruce Fields <bfields@fieldses.org> wrote:
> > 
> > On Wed, Aug 24, 2016 at 02:26:21PM +0000, Trond Myklebust wrote:
> >> 
> >>> On Aug 24, 2016, at 10:20, <bfields@fieldses.org> wrote:
> >>> I may be misunderstanding what the client's doing.  If it's doing
> >>> something like this:
> >>> 
> >>> 	- return first hundred entries to user
> >>> 	- throw out cache, restart readdir with cookie 0.
> >>> 	- skip first hundred entries, return entries 101-200 to user.
> >> 
> >> No. If the client has a cached cookie acting as the cursor, then we look for that cookie in the new stream. If we don’t find that cookie, then we do another readdir where that cookie acts as an argument, and use that to figure out where the stream now continues.
> > 
> > Got it, thanks, so the struct file caches the real server side cookie
> > even after you throw out the cached entries?  OK, I guess I need to make
> > another attempt at understanding the actual code, apologies.
> > 
> > (Doesn't that mean that in the case your last position was a deleted
> > file, you're probably going to have to read the entire directory to find
> > out the cookie's not there?  It seems so much more painful than starting
> > off with the last cookie.)
> 
> How do you cache the results of such a readdir? You'll have no reference point to figure out where you are in the stream.
> Also, how do you convert that cookie into an offset that telldir() can use?

No idea.  But then, I don't really understand how we're going to do that
even after reading the whole directory.  Any telldir offsets that we've
returned previously are in the future going to index into a completely
new array, so they seem kind of meaningless.

--b.

  reply	other threads:[~2016-08-24 15:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 15:09 I can't get no readdir satisfaction Benjamin Coddington
2016-08-23 15:36 ` Trond Myklebust
2016-08-23 21:21   ` Benjamin Coddington
2016-08-24 12:18     ` Trond Myklebust
2016-08-24 13:15       ` Benjamin Coddington
2016-08-24 13:39         ` Trond Myklebust
2016-08-24 13:56       ` J. Bruce Fields
2016-08-24 14:02         ` Trond Myklebust
2016-08-24 14:16           ` Benjamin Coddington
2016-08-24 14:19             ` Trond Myklebust
2016-08-24 15:18               ` Benjamin Coddington
2016-08-24 14:20           ` Fields Bruce James
2016-08-24 14:26             ` Trond Myklebust
2016-08-24 14:40               ` J. Bruce Fields
2016-08-24 14:53                 ` Trond Myklebust
2016-08-24 15:16                   ` Fields Bruce James [this message]
2016-08-24 13:02     ` Benjamin Coddington
2016-08-23 19:36 ` J. Bruce Fields
2016-08-23 21:50   ` Benjamin Coddington

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=20160824151620.GJ3938@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=bcodding@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@primarydata.com \
    /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).