summaryrefslogtreecommitdiffstats
path: root/xlators/features/upcall/src
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2018-06-27 14:59:40 +0530
committerAmar Tumballi <amarts@redhat.com>2018-07-11 04:11:59 +0000
commit69f77d28c3ecacba77fbae2f789b5110641347f3 (patch)
tree746f1470476a981b6becaedb6c7c1e681f457f41 /xlators/features/upcall/src
parentaf6c6429f9743f287baaad68f8e3d56ed7390d1b (diff)
md-cache: Do not invalidate cache post set/remove xattr
Since setxattr and removexattr fops cbk do not carry poststat, the stat cache was being invalidated in setxatr/remoxattr cbk. Hence the further lookup wouldn't be served from cache. To prevent this invalidation, md-cache is modified to get the poststat in set/removexattr_cbk in dict. Co-authored with Xavi Hernandez. Change-Id: I6b946be2d20b807e2578825743c25ba5927a60b4 fixes: bz#1586018 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com> Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'xlators/features/upcall/src')
-rw-r--r--xlators/features/upcall/src/upcall.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c
index dc09b2b3027..0bf1f413a94 100644
--- a/xlators/features/upcall/src/upcall.c
+++ b/xlators/features/upcall/src/upcall.c
@@ -20,7 +20,6 @@
#include "common-utils.h"
#include "statedump.h"
-#include "syncop.h"
#include "upcall.h"
#include "upcall-mem-types.h"
@@ -1697,8 +1696,7 @@ up_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!up_invalidate_needed (local->xattr))
goto out;
- ret = syncop_stat (FIRST_CHILD(frame->this), &local->loc, &stbuf,
- NULL, NULL);
+ ret = dict_get_iatt (xdata, GF_POSTSTAT, &stbuf);
if (ret == 0)
flags |= UP_TIMES;
@@ -1774,8 +1772,7 @@ up_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!up_invalidate_needed (local->xattr))
goto out;
- ret = syncop_fstat (FIRST_CHILD(frame->this), local->fd, &stbuf, NULL,
- NULL);
+ ret = dict_get_iatt (xdata, GF_POSTSTAT, &stbuf);
if (ret == 0)
flags |= UP_TIMES;
@@ -1850,8 +1847,7 @@ up_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!up_invalidate_needed (local->xattr))
goto out;
- ret = syncop_fstat (FIRST_CHILD(frame->this), local->fd, &stbuf, NULL,
- NULL);
+ ret = dict_get_iatt (xdata, GF_POSTSTAT, &stbuf);
if (ret == 0)
flags |= UP_TIMES;
@@ -1938,8 +1934,7 @@ up_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!up_invalidate_needed (local->xattr))
goto out;
- ret = syncop_stat (FIRST_CHILD(frame->this), &local->loc, &stbuf, NULL,
- NULL);
+ ret = dict_get_iatt (xdata, GF_POSTSTAT, &stbuf);
if (ret == 0)
flags |= UP_TIMES;