Return-Path: Date: Wed, 24 Aug 2016 10:40:24 -0400 From: "J. Bruce Fields" To: Trond Myklebust Cc: Coddington Benjamin , List Linux NFS Mailing Subject: Re: I can't get no readdir satisfaction Message-ID: <20160824144024.GH3938@fieldses.org> References: <778246F3-8F24-48FD-AEA9-0BCC0DCD93B3@redhat.com> <98E39192-4203-4EB8-BDE0-2A4ABFCAA92B@redhat.com> <81D2E080-0697-4B26-BE38-5E8AC35C2EA4@primarydata.com> <20160824135603.GF3938@fieldses.org> <9AB01AA0-9E40-4DD9-8C97-0EB4519E7816@primarydata.com> <20160824142049.GG3938@fieldses.org> <0876C5BD-5BF1-400B-9BDE-0D7C3CC943FD@primarydata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: <0876C5BD-5BF1-400B-9BDE-0D7C3CC943FD@primarydata.com> List-ID: On Wed, Aug 24, 2016 at 02:26:21PM +0000, Trond Myklebust wrote: > > > On Aug 24, 2016, at 10:20, 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.) --b.