>From Frank Filz <ffilz...@mindspring.com>:

Frank Filz has uploaded this change for review. ( 
https://review.gerrithub.io/405346


Change subject: GLUSTER: Use telldir result from previous dirent as cookie
......................................................................

GLUSTER: Use telldir result from previous dirent as cookie

The POSIX spec readdir has a telldir function. The value it produces is
presented to seek on the directory fd to get the next dirent. The
way filesystems seem to compute this value is a name hash of the name
of the next dirent, which sort of makes sense, if you will seek to
the next entry, you want an "offset" or "address" of that entry, not
the one you just processed.

The problem is that when creates and deletes race with readdir, the
"next" entry may change. It is actually possible to wind up with two
dirents showing the same telldir result if an entry was inserted.

What this patch does is remember the previous telldir result (using
FIRST_COOKIE as the "previous" telldir result for the first dirent) and
use that as the cookie for a given dirent. Now the cookie for each
dirent should be stable and unique (baring hash collisions, but that was
all but eliminated with the expansion of d_off from 32 bits to 64 bits -
well actually 31 to 63...).

The downside is that when presented a cookie to continue readdir from,
we will use it in seek, and fetch an entry already fetched. We just
skip that entry and start presenting the next entry.

This should result in much more stable dirent cache.

Change-Id: I461191ead93186c49adf3bdcc40f137014e73297
Signed-off-by: Frank S. Filz <ffilz...@mindspring.com>
---
M src/FSAL/FSAL_GLUSTER/handle.c
1 file changed, 31 insertions(+), 6 deletions(-)



  git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha 
refs/changes/46/405346/1
--
To view, visit https://review.gerrithub.io/405346
To unsubscribe, visit https://review.gerrithub.io/settings

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I461191ead93186c49adf3bdcc40f137014e73297
Gerrit-Change-Number: 405346
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilz...@mindspring.com>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to