From 09da0f0870dbb79d6e6dfddbfa452152c510d467 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Fri, 10 Jul 2015 11:23:07 +0530 Subject: syncop: Include iatt to 'syncop_link' args Include iatt to 'syncop_link' args to fetch proper attributes of the newly linked inode. This is backport of the below fix - http://review.gluster.org/11611 Change-Id: If6b92961bd7a89add3791ed3a9b494087348b492 BUG: 1243408 Reviewed-on: http://review.gluster.org/11611 Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Kaleb KEITHLEY Signed-off-by: Soumya Koduri Reviewed-on: http://review.gluster.org/11677 Tested-by: Gluster Build System --- libglusterfs/src/syncop.c | 10 ++++++++-- libglusterfs/src/syncop.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 9e563a8b044..019e8962598 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -2163,6 +2163,9 @@ syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref (xdata); + if (buf) + args->iatt1 = *buf; + __wake (args); return 0; @@ -2170,14 +2173,17 @@ syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int -syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *xdata_in, - dict_t **xdata_out) +syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, struct iatt *iatt, + dict_t *xdata_in, dict_t **xdata_out) { struct syncargs args = {0, }; SYNCOP (subvol, (&args), syncop_link_cbk, subvol->fops->link, oldloc, newloc, xdata_in); + if (iatt) + *iatt = args.iatt1; + if (xdata_out) *xdata_out = args.xdata; else if (args.xdata) diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index ca25d98ea38..ee6e07f47ff 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -480,7 +480,7 @@ int syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out); int syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, - dict_t *xdata_in, dict_t **xdata_out); + struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out); int syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync, dict_t *xdata_in, dict_t **xdata_out); -- cgit