From 572b4bf889d903dcaed49a57a75270a763dc259d Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 22 Sep 2017 12:50:43 +0530 Subject: features/locks: Maintain separation of lock->client_pid, flock->l_pid Problem: grant_blocked_locks() constructs flock from lock. Locks xlator uses frame->root->pid interchangeably flock->l_pid. With gNFS frame->root->pid (which translates to lock->client_pid) is not same as flock->l_pid, this leads to lk's cbk returning flock with l_pid from lock->client_pid instead of input flock->l_pid. This triggers EC's error code path leading to failure of lk call, because the response' flock->l_pid is different from request's flock->l_pid. Fix: Maintain separation of lock->client_pid, flock->l_pid. Always unwind with flock with correct pid. BUG: 1472961 Change-Id: Ifab35c458662cf0082b902f37782f8c5321d823d Signed-off-by: Pranith Kumar K --- xlators/features/locks/src/posix.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'xlators/features/locks/src/posix.c') diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 1b691c0a878..ff9a3da1a2e 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -2294,7 +2294,6 @@ pl_lk (call_frame_t *frame, xlator_t *this, /* fall through */ case F_RESLK_LCK: - memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock)); reqlock->frame = frame; reqlock->this = this; @@ -2378,8 +2377,6 @@ pl_lk (call_frame_t *frame, xlator_t *this, reqlock->frame = frame; reqlock->this = this; - memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock)); - pthread_mutex_lock (&pl_inode->mutex); { if (pl_inode->migrated) { -- cgit