summaryrefslogtreecommitdiffstats
path: root/libglusterfs
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 /libglusterfs
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 'libglusterfs')
-rw-r--r--libglusterfs/src/default-args.c4
-rw-r--r--libglusterfs/src/glusterfs.h1
-rw-r--r--libglusterfs/src/syncop.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/libglusterfs/src/default-args.c b/libglusterfs/src/default-args.c
index 9f788011ecb..2e51bf21f84 100644
--- a/libglusterfs/src/default-args.c
+++ b/libglusterfs/src/default-args.c
@@ -1454,6 +1454,8 @@ args_getactivelk_cbk_store (default_args_cbk_t *args,
INIT_LIST_HEAD (&stub_entry->list);
stub_entry->flock = entry->flock;
+ stub_entry->lk_flags = entry->lk_flags;
+
stub_entry->client_uid = gf_strdup (entry->client_uid);
if (!stub_entry->client_uid) {
GF_FREE (stub_entry);
@@ -1490,6 +1492,8 @@ args_setactivelk_store (default_args_t *args, loc_t *loc,
INIT_LIST_HEAD (&stub_entry->list);
stub_entry->flock = entry->flock;
+ stub_entry->lk_flags = entry->lk_flags;
+
stub_entry->client_uid = gf_strdup (entry->client_uid);
if (!stub_entry->client_uid) {
GF_FREE (stub_entry);
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 09bb1aecc5e..99e3b2c5aea 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -510,6 +510,7 @@ typedef struct lock_migration_info {
struct list_head list;
struct gf_flock flock;
char *client_uid;
+ uint32_t lk_flags;
} lock_migration_info_t;
#define GF_MUST_CHECK __attribute__((warn_unused_result))
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index e3d48577d2c..00a9b576269 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -3101,6 +3101,8 @@ syncop_getactivelk_cbk (call_frame_t *frame,
entry->flock = tmp->flock;
+ entry->lk_flags = tmp->lk_flags;
+
entry->client_uid = gf_strdup (tmp->client_uid);
list_add_tail (&entry->list, &args->locklist.list);