summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-07-23 14:59:19 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-07-27 01:58:46 -0700
commitf47e527db2d424a4bbe0b1e2e89106ac5d60cdea (patch)
tree5699b22ea8461fe7a3cdb9c2f893f58881750da5 /xlators/storage/posix
parent9108a9edf3743d757996b80593f71452d51a9906 (diff)
posix,shard: Fill in ia_size and ia_blocks before unwinding (f)setattr
Backport of: http://review.gluster.org/11754 The shard xlator will request for size xattrs in its request and posix will perform xattr_fill of requested keys before unwinding (f)setattr. Change-Id: I1a4c655bee99fb0d6c03062d876b36816282c2b0 BUG: 1246988 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11765 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r--xlators/storage/posix/src/posix.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index a4f8d93b44b..e7ae1e65862 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -375,6 +375,7 @@ posix_setattr (call_frame_t *frame, xlator_t *this,
char * real_path = 0;
struct iatt statpre = {0,};
struct iatt statpost = {0,};
+ dict_t *xattr_rsp = NULL;
DECLARE_OLD_FS_ID_VAR;
@@ -446,13 +447,18 @@ posix_setattr (call_frame_t *frame, xlator_t *this,
goto out;
}
+ if (xdata)
+ xattr_rsp = posix_xattr_fill (this, real_path, loc, NULL, -1,
+ xdata, &statpost);
op_ret = 0;
out:
SET_TO_OLD_FS_ID ();
STACK_UNWIND_STRICT (setattr, frame, op_ret, op_errno,
- &statpre, &statpost, NULL);
+ &statpre, &statpost, xattr_rsp);
+ if (xattr_rsp)
+ dict_unref (xattr_rsp);
return 0;
}
@@ -510,6 +516,7 @@ posix_fsetattr (call_frame_t *frame, xlator_t *this,
struct iatt statpre = {0,};
struct iatt statpost = {0,};
struct posix_fd *pfd = NULL;
+ dict_t *xattr_rsp = NULL;
int32_t ret = -1;
DECLARE_OLD_FS_ID_VAR;
@@ -590,13 +597,18 @@ posix_fsetattr (call_frame_t *frame, xlator_t *this,
goto out;
}
+ if (xdata)
+ xattr_rsp = posix_xattr_fill (this, NULL, NULL, fd, pfd->fd,
+ xdata, &statpost);
op_ret = 0;
out:
SET_TO_OLD_FS_ID ();
STACK_UNWIND_STRICT (fsetattr, frame, op_ret, op_errno,
- &statpre, &statpost, NULL);
+ &statpre, &statpost, xattr_rsp);
+ if (xattr_rsp)
+ dict_unref (xattr_rsp);
return 0;
}