summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2016-05-03 17:02:17 +0530
committerNiels de Vos <ndevos@redhat.com>2016-05-27 07:50:37 -0700
commitfc7e423d8ccbec96a4ebc5fcda6d92dc6fc59174 (patch)
tree71b2a4bec166dad559a3f358eb7fbcf2b84ddc97 /xlators/protocol
parentadfaae8dcfe00187f859b8a69268c575b2d789a1 (diff)
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. > Reviewed-on: http://review.gluster.org/14189 > Smoke: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Susant Palai <spalai@redhat.com> > Reviewed-by: Poornima G <pgurusid@redhat.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> (cherry picked from commit deaf8439fc42435988aae6a7b9ab681cc0d36b09) Change-Id: I20a7b6b6a0f3bdac5734cce8a2cd2349eceff195 BUG: 1337805 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-on: http://review.gluster.org/14457 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-helpers.c4
-rw-r--r--xlators/protocol/server/src/server-helpers.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c
index 351a10be6e6..4bdb364a9a3 100644
--- a/xlators/protocol/client/src/client-helpers.c
+++ b/xlators/protocol/client/src/client-helpers.c
@@ -1795,6 +1795,8 @@ clnt_unserialize_rsp_locklist (xlator_t *this, struct gfs3_getactivelk_rsp *rsp,
gf_proto_flock_to_flock (&trav->flock, &temp->flock);
+ temp->lk_flags = trav->lk_flags;
+
temp->client_uid = gf_strdup (trav->client_uid);
list_add_tail (&temp->list, &lmi->list);
@@ -1861,6 +1863,8 @@ serialize_req_locklist (lock_migration_info_t *locklist,
gf_proto_flock_from_flock (&trav->flock, &tmp->flock);
+ trav->lk_flags = tmp->lk_flags;
+
trav->client_uid = gf_strdup (tmp->client_uid);
if (!trav->client_uid) {
gf_msg (THIS->name, GF_LOG_ERROR, 0, 0,
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 09183e8a1dd..39fbcbc6763 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -1025,6 +1025,8 @@ serialize_rsp_locklist (lock_migration_info_t *locklist,
gf_proto_flock_from_flock (&trav->flock, &tmp->flock);
+ trav->lk_flags = tmp->lk_flags;
+
trav->client_uid = tmp->client_uid;
if (prev)
@@ -1337,6 +1339,8 @@ unserialize_req_locklist (gfs3_setactivelk_req *req,
gf_proto_flock_to_flock (&trav->flock, &temp->flock);
+ temp->lk_flags = trav->lk_flags;
+
temp->client_uid = gf_strdup (trav->client_uid);
list_add_tail (&temp->list, &lmi->list);