summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/barrier/src/barrier.c9
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-scrub.c2
-rw-r--r--xlators/features/locks/src/posix.c2
-rw-r--r--xlators/features/quota/src/quota.c27
4 files changed, 22 insertions, 18 deletions
diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c
index 4f8fa211d0b..a601c7fa04f 100644
--- a/xlators/features/barrier/src/barrier.c
+++ b/xlators/features/barrier/src/barrier.c
@@ -461,7 +461,7 @@ out:
int
notify(xlator_t *this, int event, void *data, ...)
{
- barrier_priv_t *priv = NULL;
+ barrier_priv_t *priv = this->private;
dict_t *dict = NULL;
int ret = -1;
int barrier_enabled = _gf_false;
@@ -469,7 +469,6 @@ notify(xlator_t *this, int event, void *data, ...)
0,
};
- priv = this->private;
GF_ASSERT(priv);
INIT_LIST_HEAD(&queue);
@@ -491,19 +490,23 @@ notify(xlator_t *this, int event, void *data, ...)
if (barrier_enabled) {
ret = __barrier_enable(this, priv);
} else {
+ UNLOCK(&priv->lock);
gf_log(this->name, GF_LOG_ERROR, "Already disabled.");
+ goto post_unlock;
}
} else {
if (!barrier_enabled) {
__barrier_disable(this, &queue);
ret = 0;
} else {
+ UNLOCK(&priv->lock);
gf_log(this->name, GF_LOG_ERROR, "Already enabled");
+ goto post_unlock;
}
}
}
UNLOCK(&priv->lock);
-
+ post_unlock:
if (!list_empty(&queue))
barrier_dequeue_all(this, &queue);
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
index 35318dcfa4e..a6beb2edb92 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
@@ -720,8 +720,10 @@ br_scrubber_exit_control(xlator_t *this)
if (scrub_monitor->state == BR_SCRUB_STATE_ACTIVE) {
(void)br_fsscan_activate(this);
} else {
+ UNLOCK(&scrub_monitor->lock);
gf_msg(this->name, GF_LOG_INFO, 0, BRB_MSG_SCRUB_INFO,
"Volume waiting to get rescheduled..");
+ return;
}
}
UNLOCK(&scrub_monitor->lock);
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 0feb11e3b78..3f1c7a733ff 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -504,7 +504,9 @@ pl_check_n_create_fdctx(xlator_t *this, fd_t *fd)
if (ret != 0) {
GF_FREE(fdctx);
fdctx = NULL;
+ UNLOCK(&fd->lock);
gf_log(this->name, GF_LOG_DEBUG, "failed to set fd ctx");
+ goto out;
}
}
unlock:
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 8812a301924..a0c236d4cf6 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -3292,12 +3292,11 @@ quota_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
goto out;
}
- LOCK(&ctx->lock);
- {
- if (buf)
- ctx->buf = *buf;
+ if (buf) {
+ LOCK(&ctx->lock);
+ ctx->buf = *buf;
+ UNLOCK(&ctx->lock);
}
- UNLOCK(&ctx->lock);
out:
QUOTA_STACK_UNWIND(stat, frame, op_ret, op_errno, buf, xdata);
@@ -3371,12 +3370,11 @@ quota_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
goto out;
}
- LOCK(&ctx->lock);
- {
- if (buf)
- ctx->buf = *buf;
+ if (buf) {
+ LOCK(&ctx->lock);
+ ctx->buf = *buf;
+ UNLOCK(&ctx->lock);
}
- UNLOCK(&ctx->lock);
out:
QUOTA_STACK_UNWIND(fstat, frame, op_ret, op_errno, buf, xdata);
@@ -3666,12 +3664,11 @@ quota_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
goto out;
}
- LOCK(&ctx->lock);
- {
- if (statpost)
- ctx->buf = *statpost;
+ if (statpost) {
+ LOCK(&ctx->lock);
+ ctx->buf = *statpost;
+ UNLOCK(&ctx->lock);
}
- UNLOCK(&ctx->lock);
out:
QUOTA_STACK_UNWIND(setattr, frame, op_ret, op_errno, statpre, statpost,