diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2019-04-17 00:16:49 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2019-04-22 14:03:35 +0000 |
commit | a0814b96828505441fbb7f1801e751d98f5a1cc0 (patch) | |
tree | b759e09776e1d822245520307b574c9a176a6b46 /xlators/features | |
parent | d9bfccc8425befa5d13058b5f5352598a2085161 (diff) |
features/sdfs: Assign unique lk-owner for entrylk fop
sdfs is supposed to serialize entry fops by doing entrylk, but all the locks
are being done with all-zero lk-owner. In essence sdfs doesn't achieve its goal
of mutual exclusion when conflicting operations are executed by same client
because two locks on same entry with same all-zero-owner will get locks.
Fixed this up by assigning lk-owner before taking entrylk
updates bz#1624701
Change-Id: Ifabfc998c9f1724915d38e90ed8287e05797d769
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/sdfs/src/sdfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c index f0247fdcde8..b3fbc01caf7 100644 --- a/xlators/features/sdfs/src/sdfs.c +++ b/xlators/features/sdfs/src/sdfs.c @@ -139,6 +139,8 @@ sdfs_get_new_frame_common(call_frame_t *frame, call_frame_t **new_frame) } local->main_frame = frame; + /*Set unique lk-owner for the fop*/ + set_lk_owner_from_ptr(&(*new_frame)->root->lk_owner, (*new_frame)->root); ret = 0; err: @@ -868,6 +870,8 @@ sdfs_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, op_errno = ENOMEM; goto err; } + /*Set unique lk-owner for the fop*/ + set_lk_owner_from_ptr(&new_frame->root->lk_owner, new_frame->root); gf_client_ref(client); new_frame->root->client = client; @@ -1121,6 +1125,8 @@ sdfs_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, op_errno = ENOMEM; goto err; } + /*Set unique lk-owner for the fop*/ + set_lk_owner_from_ptr(&new_frame->root->lk_owner, new_frame->root); gf_client_ref(client); new_frame->root->client = client; |