>From Frank Filz <ffilz...@mindspring.com>:
Frank Filz has uploaded this change for review. (
https://review.gerrithub.io/367445
Change subject: MDCACHE: Clean up directory validation
......................................................................
MDCACHE: Clean up directory validation
The addition of chunked directories was not implemeneted with correct
directory invalidation. A new validation bit is added to indicate if
the cached chunks can be trusted, with this, we have three bits that
define the validity of directories:
MDCACHE_TRUST_CONTENT - The dirent cache can be trusted, any entries
may be assumed to reference valid files
subject to the limits of invalidation.
MDCACHE_DIR_POPULATED - The dirent cache contains all direns for the
directory. With this bit set, it is possible
to server negative lookups.
MDCACHE_TRUST_DIR_CHUNKS - Any chunks cached can be considered valid.
The conditions under which these are set and cleared are as follows:
MDCACHE_TRUST_CONTENT is set as soon as the dirent cache is cleaned
up after invalidation. It is cleared by an upcall invalidation and
one special case of rename overwriting a directory (which must be
empty so not really a very interesting case).
MDCACHE_DIR_POPULATED is set by the legacy readdir, or by a
chunked mdcache readdir that starts at whence == 0 and reads through
to end of directory. It is cleared by an upcall invalidation, by the
addition of a new directory entry when the FSAL doesn't support
cookie computation, whenever the dirent cache is cleared, if a chunk
is reclaimed by LRU, and by a chunked readdir that does NOT set the
flag.
MDCACHE_TRUST_DIR_CHUNKS is set when the dirent cache is cleared and
is cleared by an upcall invalidation or the addition of a new directory
entry when the FSAL doesn't support cookie computation.
This patch also updates FSAL_RGW to properly invalidate all of these
flags on an invalidate upcall.
This patch also assures that attributes are properly invalidated
when a dirent is added to a directory and they are refreshed when
we can add dirent so that we can avoid invalidating the dirent
cache because Ganesha added a dirent and thus caused mtime to
change.
Also, don't use mdcache_dirent_rename for chunked directories, the
long form code does more correct directory invalidation.
Change-Id: Idfde88658a4ff637965c8ab0c796f90961b9b485
Signed-off-by: Frank S. Filz <ffilz...@mindspring.com>
---
M src/FSAL/FSAL_RGW/up.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_int.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.c
M src/include/fsal_up.h
6 files changed, 157 insertions(+), 60 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha
refs/changes/45/367445/1
--
To view, visit https://review.gerrithub.io/367445
To unsubscribe, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfde88658a4ff637965c8ab0c796f90961b9b485
Gerrit-Change-Number: 367445
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