summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker.c
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-07-29 16:42:20 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-09-20 23:49:16 -0700
commit6cbb306c24400b0a6df5cb71f540f1f0190fcc25 (patch)
tree63b36f9782f1298dd41c8919d2aca1d5ad671f1f /xlators/features/marker/src/marker.c
parent3044ea596c51b183d3449fcca70c3c903d6b502f (diff)
quota/marker: set lk_owner when taking lock on parent in rename
This is a backport of http://review.gluster.org/#/c/11561/ Before doing a rename operation marker takes inode lock on the file parent, here lk_owner is NULL and this can cause accounting problem with multiple rename on the same directory This patch fix the problem by setting lk_owner > Change-Id: Ibb789e39b2833e425d0a5fca85282ff1465206cb > BUG: 1240598 > Signed-off-by: vmallika <vmallika@redhat.com> > Reviewed-on: http://review.gluster.org/11561 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Tested-by: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I54db6c27791862e84eaa958fc9fdc363a22eb2e8 BUG: 1247972 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11795 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features/marker/src/marker.c')
-rw-r--r--xlators/features/marker/src/marker.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 1814cdc8f8e..8e026ec79a9 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -1575,6 +1575,9 @@ marker_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
+ if (is_lk_owner_null (&frame->root->lk_owner))
+ set_lk_owner_from_ptr (&frame->root->lk_owner, frame->root);
+
STACK_WIND (frame,
marker_rename_inodelk_cbk,
FIRST_CHILD(this),