diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2016-05-03 14:43:20 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-05-06 05:26:26 -0700 |
commit | fd8921b9eb03af69815bb2d7cff07b63048c2d5a (patch) | |
tree | 6f124e292ec227556559364e6a6c6e10a304998e /xlators/cluster/dht/src/dht-common.h | |
parent | 1779bd895066750da95054b45175bf68752878b7 (diff) |
dht:remember locked subvol and send unlock to the same
During locking we send lock request to cached subvol,
and normally we unlock to the cached subvol
But with parallel fresh lookup on a directory, there
is a race window where the cached subvol can change
and the unlock can go into a different subvol from
which we took lock.
This will result in a stale lock held on one of the
subvol.
So we will store the details of subvol which we took the lock
and will unlock from the same subvol
back port of>
>Change-Id: I47df99491671b10624eb37d1d17e40bacf0b15eb
>BUG: 1311002
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
>Reviewed-on: http://review.gluster.org/13492
>Reviewed-by: N Balachandran <nbalacha@redhat.com>
>Smoke: Gluster Build System <jenkins@build.gluster.com>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Change-Id: Ia847e7115d2296ae9811b14a956f3b6bf39bd86d
BUG: 1333645
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/14236
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: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 369b7d40bcc..b15c2064226 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -106,6 +106,7 @@ typedef struct dht_stat_time dht_stat_time_t; struct dht_inode_ctx { dht_layout_t *layout; dht_stat_time_t time; + xlator_t *lock_subvol; }; typedef struct dht_inode_ctx dht_inode_ctx_t; @@ -288,6 +289,8 @@ struct dht_local { int op_errno; } lock; + short lock_type; + call_stub_t *stub; int32_t parent_disk_layout[4]; }; @@ -1204,4 +1207,12 @@ dht_release (xlator_t *this, fd_t *fd); int32_t dht_set_fixed_dir_stat (struct iatt *stat); + +xlator_t* +dht_get_lock_subvolume (xlator_t *this, struct gf_flock *lock, + dht_local_t *local); + +int +dht_lk_inode_unref (call_frame_t *frame, int32_t op_ret); + #endif/* _DHT_H */ |