yoni(a)weka.io has uploaded this change for review. (
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/491544 )
Change subject: MDCACHE - Fix cache trust when file is modified during getattr
......................................................................
MDCACHE - Fix cache trust when file is modified during getattr
When mdcache_refresh_attrs is called, first it refreshes the attributes and
then it sets MDCACHE_TRUST_ATTRS so the next getattr calls will use the
cached results. If write happened while attrs are being refreshed it means
the attrs are stale at that point and shouldn't be cached.
Introducing attr_generation solves that problem by increasing the generation
every time a write occurs, comparing the generation before and after
refreshing attributes and setting the MDCACHE_TRUST_ATTRS flag only if the
generation didn't change during that time.
Change-Id: I9f22aac2046b305c4d3796e05526781eacbbbe7d
Signed-off-by: Yoni Knobil <yoni(a)weka.io>
---
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_file.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_int.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.c
4 files changed, 19 insertions(+), 2 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/44/491544/1
--
To view, visit
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/491544
To unsubscribe, or for help writing mail filters, visit
https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I9f22aac2046b305c4d3796e05526781eacbbbe7d
Gerrit-Change-Number: 491544
Gerrit-PatchSet: 1
Gerrit-Owner: yoni(a)weka.io
Gerrit-MessageType: newchange