summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-07-10 11:23:07 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-07-15 08:08:30 -0700
commit09da0f0870dbb79d6e6dfddbfa452152c510d467 (patch)
tree392d6db51ca10f9ba3c254f77a977fe6356bc323 /api
parent94b0109a8ed55d5aebe0604ffb19cbb583797cf5 (diff)
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 <srangana@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/11677 Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-fops.c4
-rw-r--r--api/src/glfs-handleops.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 2997452..eaf1805 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -1996,7 +1996,7 @@ retrynew:
}
newloc.inode = inode_ref (oldloc.inode);
- ret = syncop_link (subvol, &oldloc, &newloc, NULL, NULL);
+ ret = syncop_link (subvol, &oldloc, &newloc, &newiatt, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret == -1 && errno == ESTALE) {
@@ -2007,7 +2007,7 @@ retrynew:
}
if (ret == 0)
- ret = glfs_loc_link (&newloc, &oldiatt);
+ ret = glfs_loc_link (&newloc, &newiatt);
out:
loc_wipe (&oldloc);
loc_wipe (&newloc);
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 9a85f19..2e552b7 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1572,6 +1572,7 @@ pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
inode_t *pinode = NULL;
loc_t oldloc = {0, };
loc_t newloc = {0, };
+ struct iatt iatt = {0, };
DECLARE_OLD_THIS;
@@ -1629,12 +1630,11 @@ pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
newloc.inode = inode_ref (inode);
/* fop/op */
- ret = syncop_link (subvol, &oldloc, &newloc, NULL, NULL);
+ ret = syncop_link (subvol, &oldloc, &newloc, &iatt, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret == 0)
- /* TODO: No iatt to pass as there has been no lookup */
- ret = glfs_loc_link (&newloc, NULL);
+ ret = glfs_loc_link (&newloc, &iatt);
out:
loc_wipe (&oldloc);
loc_wipe (&newloc);