From deaf8439fc42435988aae6a7b9ab681cc0d36b09 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Tue, 3 May 2016 17:02:17 +0530 Subject: core: Honour mandatory lock flags during lock migration lk_flags from posix_lock_t structure is the primary key used to differentiate locks as either advisory and mandatory type. During lock migration this field is not read in getactivelk() call path. So in order to copy the exact lock state from source to destination it is necessary to include lk_flags within lock_migration_info_t structure to maintain accurate state. This change also includes minor modifications to setactivelk() call to consider lk_flags during lock migration. Change-Id: I20a7b6b6a0f3bdac5734cce8a2cd2349eceff195 BUG: 1332501 Signed-off-by: Anoop C S Reviewed-on: http://review.gluster.org/14189 Smoke: Gluster Build System Reviewed-by: Susant Palai Reviewed-by: Poornima G NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/features/locks/src/posix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/features') diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index ed07dd4b1a4..f53af6345df 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -2708,6 +2708,8 @@ gf_mig_info_for_lock (posix_lock_t *lock) posix_lock_to_flock (lock, &new->flock); + new->lk_flags = lock->lk_flags; + new->client_uid = gf_strdup (lock->client_uid); out: @@ -3385,6 +3387,8 @@ gf_lkmig_info_to_posix_lock (call_frame_t *frame, lock->client = frame->root->client; + lock->lk_flags = lmi->lk_flags; + lock->client_uid = gf_strdup (lmi->client_uid); if (lock->client_uid == NULL) { GF_FREE (lock); -- cgit