diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2017-01-17 16:40:04 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2018-07-28 09:27:38 +0000 |
commit | 7131de81f72dda0ef685ed60d0887c6e14289b8c (patch) | |
tree | 0fe37d41fb6ff3c8cc1d93462fb37932ab50e95d /libglusterfs | |
parent | 2e0744570fe1f6148e0c7b1c1a5bf98cc4eaf990 (diff) |
performance/readdir-ahead: Invalidate cached dentries if they're modified while in cache
PROBLEM:
Entries that are readdirp'd ahead can undergo modification in terms
of writes, truncates which could modify their iatts. When a readdir
is finally wound at offset corresponding to these entries, the iatts
that are returned to the application come from readdir-ahead's cache,
which are stale by now. This problem gets further aggravated when caching
translators/modules cache and continue to serve this stale information.
FIX:
Whenever a dentry undergoes modification, in the cbk of the modification fop,
a "dirty" flag (default 0) is set in its inode ctx. When it's time for
readdir-ahead to serve these entries, it will read the inode ctx and check
if the entry is "dirty", and if it is, set the entry's attrs to all zeroes,
as an indicator to fuse, md-cache etc not to cache these attributes.
Also there is one tiny race between the entry creation and a readdirp on its
parent dir, which could cause the inode-ctx setting and inode ctx reading to
happen on two different inode objects. To prevent this, fuse-bridge is made to
drop entries for which dentry->inode is not the same as linked inode,
in readdirp cbk.
Change-Id: If7396507632b5268442ca580473d5155fee9cbef
BUG: 1390050
Updates: bz#1390050
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/inode.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index f77778ff3ad..658477700c0 100644 --- a/libglusterfs/src/inode.h +++ b/libglusterfs/src/inode.h @@ -258,6 +258,7 @@ inode_ctx_put(inode_t *inode, xlator_t *this, uint64_t v) #define inode_ctx_get(i,x,v) inode_ctx_get0(i,x,v) #define inode_ctx_del(i,x,v) inode_ctx_del2(i,x,v,0) +#define inode_ctx_del1(i, x, v) inode_ctx_del2(i, x, 0, v) gf_boolean_t __is_root_gfid (uuid_t gfid); |