From fd296d90168002a475a9899a72a0dd1811f038ee Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 23 Jul 2015 14:59:19 +0530 Subject: posix,shard: Fill in ia_size and ia_blocks before unwinding (f)setattr 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: I4ec4779568be6f805724b875b1b4215787112e7f BUG: 1246082 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/11754 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: NetBSD Build System --- xlators/storage/posix/src/posix.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 7589e8c7cc2..047600e2e21 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -370,6 +370,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; @@ -441,13 +442,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; } @@ -505,6 +511,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; @@ -585,13 +592,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; } -- cgit