diff options
author | Poornima G <pgurusid@redhat.com> | 2017-02-16 13:05:25 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-02-20 00:11:42 -0500 |
commit | 73defab8be16b73241225bb1c2588a61e3e425d5 (patch) | |
tree | 3901c9f94665159551a97b2c3b0a48fb820a6848 /xlators/features | |
parent | 4badd7334d345b1c27f528140e4c28afaf1f32f6 (diff) |
marker: Fix inode value in loc, in setxattr fop
On recieving a rename fop, marker_rename() stores the,
oldloc and newloc in its 'local' struct, once the rename
is done, the xtime marker(last updated time) is set on
the file, but sending a setxattr fop. When upcall
receives the setxattr fop, the loc->inode is NULL and
it crashes. The loc->inode can be NULL only in one valid
case, i.e. in rename case where the inode of new loc
can be NULL. Hence, marker should have filled the inode
of the new_loc before issuing a setxattr.
marker_rename_cbk was already fixed in a previous commit.
Fixing marker_rename_done to send valid inode in this commit.
Also in upcall check for NULL inode so that there is no crash.
Change-Id: I3ed2a05118fed3367dfe3251ce4477310cb480d0
BUG: 1422776
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: https://review.gluster.org/16633
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: soumya k <skoduri@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/marker/src/marker.c | 2 | ||||
-rw-r--r-- | xlators/features/upcall/src/upcall.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index f578f6c3f44..b51b9ccc9f5 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -1292,6 +1292,8 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this, loc_wipe (&newloc); if (priv->feature_enabled & GF_XTIME) { + if (!local->loc.inode) + local->loc.inode = inode_ref (oplocal->loc.inode); //update marks on oldpath gf_uuid_copy (local->loc.gfid, oplocal->loc.inode->gfid); marker_xtime_update_marks (this, oplocal); diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c index 19180e555f5..40ad1c4e379 100644 --- a/xlators/features/upcall/src/upcall.c +++ b/xlators/features/upcall/src/upcall.c @@ -2245,6 +2245,10 @@ upcall_local_init (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, { upcall_local_t *local = NULL; + GF_VALIDATE_OR_GOTO ("upcall", this, out); + GF_VALIDATE_OR_GOTO (this->name, frame, out); + GF_VALIDATE_OR_GOTO (this->name, inode, out); + local = mem_get0 (THIS->local_pool); if (!local) |