summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-06-10 10:30:03 +0530
committerVijay Bellur <vbellur@redhat.com>2015-06-10 23:37:07 -0700
commit5c00a6c8163cc255e777823b99d516dfb5ef114e (patch)
tree1c94fd51506eeb341d7f2dfb79e2713461f16b4a /xlators/cluster/ec/src/ec.c
parentec7d0c3de11cbee1470308dcc10ec9f02e7fdfff (diff)
cluster/ec: Wind unlock fops at all cost
Problem: While files are being created if more than redundancy number of bricks go down, then unlock for these fops do not go to the bricks. This will lead to stale locks leading to hangs. Fix: Wind unlock fops at all costs. Change-Id: I50a87e8b4d6d2dde5bf7405b82e3aeecd95ad00e BUG: 1220348 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/11152 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Diffstat (limited to 'xlators/cluster/ec/src/ec.c')
-rw-r--r--xlators/cluster/ec/src/ec.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index 4028aa4d2bb..797c390e383 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -625,7 +625,10 @@ int32_t ec_gf_entrylk(call_frame_t * frame, xlator_t * this,
const char * volume, loc_t * loc, const char * basename,
entrylk_cmd cmd, entrylk_type type, dict_t * xdata)
{
- ec_entrylk(frame, this, -1, EC_MINIMUM_ALL, default_entrylk_cbk, NULL,
+ int32_t minimum = EC_MINIMUM_ALL;
+ if (cmd == ENTRYLK_UNLOCK)
+ minimum = EC_MINIMUM_ONE;
+ ec_entrylk(frame, this, -1, minimum, default_entrylk_cbk, NULL,
volume, loc, basename, cmd, type, xdata);
return 0;
@@ -635,7 +638,10 @@ int32_t ec_gf_fentrylk(call_frame_t * frame, xlator_t * this,
const char * volume, fd_t * fd, const char * basename,
entrylk_cmd cmd, entrylk_type type, dict_t * xdata)
{
- ec_fentrylk(frame, this, -1, EC_MINIMUM_ALL, default_fentrylk_cbk, NULL,
+ int32_t minimum = EC_MINIMUM_ALL;
+ if (cmd == ENTRYLK_UNLOCK)
+ minimum = EC_MINIMUM_ONE;
+ ec_fentrylk(frame, this, -1, minimum, default_fentrylk_cbk, NULL,
volume, fd, basename, cmd, type, xdata);
return 0;
@@ -772,7 +778,11 @@ int32_t ec_gf_inodelk(call_frame_t * frame, xlator_t * this,
const char * volume, loc_t * loc, int32_t cmd,
struct gf_flock * flock, dict_t * xdata)
{
- ec_inodelk(frame, this, -1, EC_MINIMUM_ALL, default_inodelk_cbk, NULL,
+ int32_t minimum = EC_MINIMUM_ALL;
+ if (flock->l_type == F_UNLCK)
+ minimum = EC_MINIMUM_ONE;
+
+ ec_inodelk(frame, this, -1, minimum, default_inodelk_cbk, NULL,
volume, loc, cmd, flock, xdata);
return 0;
@@ -782,7 +792,10 @@ int32_t ec_gf_finodelk(call_frame_t * frame, xlator_t * this,
const char * volume, fd_t * fd, int32_t cmd,
struct gf_flock * flock, dict_t * xdata)
{
- ec_finodelk(frame, this, -1, EC_MINIMUM_ALL, default_finodelk_cbk, NULL,
+ int32_t minimum = EC_MINIMUM_ALL;
+ if (flock->l_type == F_UNLCK)
+ minimum = EC_MINIMUM_ONE;
+ ec_finodelk(frame, this, -1, minimum, default_finodelk_cbk, NULL,
volume, fd, cmd, flock, xdata);
return 0;
@@ -800,7 +813,10 @@ int32_t ec_gf_link(call_frame_t * frame, xlator_t * this, loc_t * oldloc,
int32_t ec_gf_lk(call_frame_t * frame, xlator_t * this, fd_t * fd,
int32_t cmd, struct gf_flock * flock, dict_t * xdata)
{
- ec_lk(frame, this, -1, EC_MINIMUM_ALL, default_lk_cbk, NULL, fd, cmd,
+ int32_t minimum = EC_MINIMUM_ALL;
+ if (flock->l_type == F_UNLCK)
+ minimum = EC_MINIMUM_ONE;
+ ec_lk(frame, this, -1, minimum, default_lk_cbk, NULL, fd, cmd,
flock, xdata);
return 0;