3604df
From 03bafe884a2005a646bbe5cc1aa032b2e324e5c7 Mon Sep 17 00:00:00 2001
3604df
From: Poornima G <pgurusid@redhat.com>
3604df
Date: Wed, 29 Jun 2016 05:31:03 -0400
3604df
Subject: [PATCH 114/141] upcall: Invalidation for xattr should also carry a valid stat
3604df
3604df
xattr modification also impacts the ctime of the file, hence
3604df
include the new stat along with the new xattrs, in the
3604df
invalidation request
3604df
3604df
Change-Id: Ieaa4382fa62f397f61a995b926013b9207c6e9da
3604df
BUG: 1284873
3604df
Signed-off-by: Poornima G <pgurusid@redhat.com>
3604df
Reviewed-on: http://review.gluster.org/14828
3604df
Smoke: Gluster Build System <jenkins@build.gluster.org>
3604df
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
3604df
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
3604df
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
3604df
Reviewed-on: https://code.engineering.redhat.com/gerrit/87027
3604df
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
3604df
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
3604df
---
3604df
 xlators/features/upcall/src/upcall.c |  119 ++++++++++++++++++++++-----------
3604df
 xlators/features/upcall/src/upcall.h |    5 +-
3604df
 2 files changed, 83 insertions(+), 41 deletions(-)
3604df
3604df
diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c
3604df
index 4ae0ab0..68f1572 100644
3604df
--- a/xlators/features/upcall/src/upcall.c
3604df
+++ b/xlators/features/upcall/src/upcall.c
3604df
@@ -65,7 +65,7 @@ up_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -121,7 +121,7 @@ up_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -180,7 +180,7 @@ up_readv (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -236,7 +236,7 @@ up_lk (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -291,7 +291,7 @@ up_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -352,7 +352,7 @@ up_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -412,7 +412,7 @@ up_rename (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, oldloc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, oldloc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -471,7 +471,7 @@ up_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -527,7 +527,7 @@ up_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, oldloc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, oldloc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -585,7 +585,7 @@ up_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -644,7 +644,7 @@ up_mkdir (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->parent, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->parent, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -706,7 +706,7 @@ up_create (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->parent, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->parent, NULL);
3604df
 
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
@@ -765,7 +765,7 @@ up_lookup (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -821,7 +821,7 @@ up_stat (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -849,7 +849,7 @@ up_fstat (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -877,7 +877,7 @@ up_ftruncate (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -932,7 +932,7 @@ up_access (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -988,7 +988,7 @@ up_readlink (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1048,7 +1048,7 @@ up_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->parent, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->parent, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1109,7 +1109,7 @@ up_symlink (call_frame_t   *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->parent, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->parent, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1165,7 +1165,7 @@ up_opendir (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1220,7 +1220,7 @@ up_statfs (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1275,7 +1275,7 @@ up_readdir (call_frame_t  *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1303,7 +1303,7 @@ up_readdirp (call_frame_t *frame, xlator_t *this,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1331,7 +1331,7 @@ up_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1388,7 +1388,7 @@ up_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1445,7 +1445,7 @@ up_discard(call_frame_t *frame, xlator_t *this, fd_t *fd,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1502,7 +1502,7 @@ up_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1559,7 +1559,7 @@ up_seek (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1586,6 +1586,7 @@ up_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
         uint32_t         flags          = 0;
3604df
         upcall_local_t   *local         = NULL;
3604df
         int              ret            = 0;
3604df
+        struct iatt      stbuf          = {0, };
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
@@ -1603,8 +1604,14 @@ up_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
                 op_ret = ret;
3604df
                 goto out;
3604df
         }
3604df
+
3604df
+        ret = syncop_stat (FIRST_CHILD(frame->this), &local->loc, &stbuf,
3604df
+                           NULL, NULL);
3604df
+        if (ret == 0)
3604df
+                flags |= UP_TIMES;
3604df
+
3604df
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
3604df
-                                 NULL, NULL, NULL, local->xattr);
3604df
+                                 &stbuf, NULL, NULL, local->xattr);
3604df
 
3604df
 out:
3604df
         UPCALL_STACK_UNWIND (setxattr, frame, op_ret, op_errno, xdata);
3604df
@@ -1629,7 +1636,7 @@ up_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
3604df
                 goto err;
3604df
         }
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, xattr);
3604df
+        local = upcall_local_init (frame, this, loc, NULL, loc->inode, xattr);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1657,6 +1664,7 @@ up_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
         uint32_t         flags          = 0;
3604df
         upcall_local_t   *local         = NULL;
3604df
         int              ret            = 0;
3604df
+        struct iatt      stbuf          = {0,};
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
@@ -1674,8 +1682,14 @@ up_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
                 op_ret = ret;
3604df
                 goto out;
3604df
         }
3604df
+
3604df
+        ret = syncop_fstat (FIRST_CHILD(frame->this), local->fd, &stbuf, NULL,
3604df
+                            NULL);
3604df
+        if (ret == 0)
3604df
+                flags |= UP_TIMES;
3604df
+
3604df
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
3604df
-                                 NULL, NULL, NULL, local->xattr);
3604df
+                                 &stbuf, NULL, NULL, local->xattr);
3604df
 
3604df
 out:
3604df
         UPCALL_STACK_UNWIND (fsetxattr, frame, op_ret, op_errno, xdata);
3604df
@@ -1700,7 +1714,7 @@ up_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
3604df
                 goto err;
3604df
         }
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, xattr);
3604df
+        local = upcall_local_init (frame, this, NULL, fd, fd->inode, xattr);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1727,6 +1741,8 @@ up_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
         client_t         *client        = NULL;
3604df
         uint32_t         flags          = 0;
3604df
         upcall_local_t   *local         = NULL;
3604df
+        struct iatt      stbuf          = {0,};
3604df
+        int              ret            = 0;
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
@@ -1737,8 +1753,14 @@ up_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
                 goto out;
3604df
         }
3604df
         flags = UP_XATTR_RM;
3604df
+
3604df
+        ret = syncop_fstat (FIRST_CHILD(frame->this), local->fd, &stbuf, NULL,
3604df
+                            NULL);
3604df
+        if (ret == 0)
3604df
+                flags |= UP_TIMES;
3604df
+
3604df
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
3604df
-                                 NULL, NULL, NULL, local->xattr);
3604df
+                                 &stbuf, NULL, NULL, local->xattr);
3604df
 
3604df
 out:
3604df
         UPCALL_STACK_UNWIND (fremovexattr, frame, op_ret, op_errno,
3604df
@@ -1763,7 +1785,7 @@ up_fremovexattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
3604df
                 goto err;
3604df
         }
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, xattr);
3604df
+        local = upcall_local_init (frame, this, NULL, fd, fd->inode, xattr);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1789,6 +1811,8 @@ up_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
         client_t         *client        = NULL;
3604df
         uint32_t         flags          = 0;
3604df
         upcall_local_t   *local         = NULL;
3604df
+        struct iatt      stbuf          = {0,};
3604df
+        int              ret            = 0;
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
@@ -1799,8 +1823,14 @@ up_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
                 goto out;
3604df
         }
3604df
         flags = UP_XATTR_RM;
3604df
+
3604df
+        ret = syncop_stat (FIRST_CHILD(frame->this), &local->loc, &stbuf, NULL,
3604df
+                           NULL);
3604df
+        if (ret == 0)
3604df
+                flags |= UP_TIMES;
3604df
+
3604df
         upcall_cache_invalidate (frame, this, client, local->inode, flags,
3604df
-                                 NULL, NULL, NULL, local->xattr);
3604df
+                                 &stbuf, NULL, NULL, local->xattr);
3604df
 
3604df
 out:
3604df
         UPCALL_STACK_UNWIND (removexattr, frame, op_ret, op_errno,
3604df
@@ -1825,7 +1855,7 @@ up_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
3604df
                 goto err;
3604df
         }
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, xattr);
3604df
+        local = upcall_local_init (frame, this, loc, NULL, loc->inode, xattr);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1882,7 +1912,7 @@ up_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, fd->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, fd->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1937,7 +1967,7 @@ up_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
3604df
 
3604df
         EXIT_IF_UPCALL_OFF (this, out);
3604df
 
3604df
-        local = upcall_local_init (frame, this, loc->inode, NULL);
3604df
+        local = upcall_local_init (frame, this, NULL, NULL, loc->inode, NULL);
3604df
         if (!local) {
3604df
                 op_errno = ENOMEM;
3604df
                 goto err;
3604df
@@ -1988,12 +2018,16 @@ upcall_local_wipe (xlator_t *this, upcall_local_t *local)
3604df
                         dict_destroy (local->xattr);
3604df
                 }
3604df
                 loc_wipe (&local->rename_oldloc);
3604df
+                loc_wipe (&local->loc);
3604df
+                if (local->fd)
3604df
+                        fd_unref (local->fd);
3604df
                 mem_put (local);
3604df
         }
3604df
 }
3604df
 
3604df
 upcall_local_t *
3604df
-upcall_local_init (call_frame_t *frame, xlator_t *this, inode_t *inode, dict_t *xattr)
3604df
+upcall_local_init (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
3604df
+                   inode_t *inode, dict_t *xattr)
3604df
 {
3604df
         upcall_local_t *local = NULL;
3604df
 
3604df
@@ -2009,6 +2043,11 @@ upcall_local_init (call_frame_t *frame, xlator_t *this, inode_t *inode, dict_t *
3604df
         /* Shall we get inode_ctx and store it here itself? */
3604df
         local->upcall_inode_ctx = upcall_inode_ctx_get (inode, this);
3604df
 
3604df
+        if (loc)
3604df
+                loc_copy (&local->loc, loc);
3604df
+        if (fd)
3604df
+                local->fd = fd_ref (fd);
3604df
+
3604df
         frame->local = local;
3604df
 
3604df
 out:
3604df
diff --git a/xlators/features/upcall/src/upcall.h b/xlators/features/upcall/src/upcall.h
3604df
index 788555b..f868493 100644
3604df
--- a/xlators/features/upcall/src/upcall.h
3604df
+++ b/xlators/features/upcall/src/upcall.h
3604df
@@ -84,13 +84,16 @@ struct upcall_local {
3604df
         upcall_inode_ctx_t *upcall_inode_ctx;
3604df
         inode_t   *inode;
3604df
         loc_t     rename_oldloc;
3604df
+        loc_t     loc;  /* required for stat in *xattr_cbk */
3604df
+        fd_t      *fd;  /* required for fstat in *xattr_cbk */
3604df
         dict_t    *xattr;
3604df
 };
3604df
 typedef struct upcall_local upcall_local_t;
3604df
 
3604df
 void upcall_local_wipe (xlator_t *this, upcall_local_t *local);
3604df
 upcall_local_t *upcall_local_init (call_frame_t *frame, xlator_t *this,
3604df
-                                   inode_t *inode, dict_t *xattr);
3604df
+                                   loc_t *loc, fd_t *fd, inode_t *inode,
3604df
+                                   dict_t *xattr);
3604df
 
3604df
 upcall_client_t *add_upcall_client (call_frame_t *frame, client_t *client,
3604df
                                     upcall_inode_ctx_t *up_inode_ctx);
3604df
-- 
3604df
1.7.1
3604df