summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorDavid Spisla <david.spisla@iternity.com>2017-02-17 13:06:44 +0100
committerNiels de Vos <ndevos@redhat.com>2017-04-12 07:27:09 -0400
commit1b01bdcc8effb9b5342edbe669b9e2b2c36bfc80 (patch)
tree5bd29897cb932dfd5b9691e59daada5f46e452f3 /xlators/features
parent6b8df081b46ac4f485c86a5052fc30472e74bfbb (diff)
worm: allow Self-heal-Daemon to perform some operations
The Self-Heal-Daemon should be allowed to trigger unlink, link, trauncate, rename and write operation. The value of frame->root->pid can be used to detect internal (by SHD) operations. Change-Id: I7526148100bef1e2837d69df5c119dc97d91fffd BUG: 1423413 Signed-off-by: David Spisla <david.spisla@iternity.com> Reviewed-on: https://review.gluster.org/16661 Tested-by: jiffin tony Thottan <jthottan@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/read-only/src/worm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c
index c7f9b9288dd..9a956ccd873 100644
--- a/xlators/features/read-only/src/worm.c
+++ b/xlators/features/read-only/src/worm.c
@@ -57,7 +57,7 @@ worm_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
GF_ASSERT (priv);
if (is_readonly_or_worm_enabled (this))
goto out;
- if (!priv->worm_file) {
+ if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
goto out;
}
@@ -94,7 +94,7 @@ worm_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
if (is_readonly_or_worm_enabled (this)) {
goto out;
}
- if (!priv->worm_file) {
+ if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
goto out;
}
@@ -129,7 +129,7 @@ worm_rename (call_frame_t *frame, xlator_t *this,
GF_ASSERT (priv);
if (is_readonly_or_worm_enabled (this))
goto out;
- if (!priv->worm_file) {
+ if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
goto out;
}
@@ -165,7 +165,7 @@ worm_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
GF_ASSERT (priv);
if (is_readonly_or_worm_enabled (this))
goto out;
- if (!priv->worm_file) {
+ if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
goto out;
}
@@ -396,7 +396,7 @@ worm_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
priv = this->private;
GF_ASSERT (priv);
- if (!priv->worm_file) {
+ if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
goto out;
}
(dict_t *dict, int i, int brick_count)
cli_vol_type_str[vol_type]);
gf_cli_print_number_of_bricks (hot_type,
hot_brick_count, hot_dist_count, 0,
- hot_replica_count, 0, 0);
+ hot_replica_count, 0, 0, 0);
ret = print_brick_details (dict, i, 1, hot_brick_count);
if (ret)
@@ -711,7 +726,7 @@ gf_cli_print_tier_info (dict_t *dict, int i, int brick_count)
gf_cli_print_number_of_bricks (cold_type,
cold_brick_count,
cold_dist_count, 0, cold_replica_count,
- cold_disperse_count, cold_redundancy_count);
+ cold_disperse_count, cold_redundancy_count, 0);
ret = print_brick_details (dict, i, hot_brick_count+1,
brick_count);
@@ -737,6 +752,7 @@ gf_cli_get_volume_cbk (struct rpc_req *req, struct iovec *iov,
int32_t replica_count = 0;
int32_t disperse_count = 0;
int32_t redundancy_count = 0;
+ int32_t arbiter_count = 0;
int32_t vol_type = 0;
int32_t transport = 0;
char *volume_id_str = NULL;
@@ -900,6 +916,11 @@ xml_output:
if (ret)
goto out;
+ snprintf (key, sizeof(key), "volume%d.arbiter_count", i);
+ ret = dict_get_int32 (dict, key, &arbiter_count);
+ if (ret)
+ goto out;
+
snprintf (key, 256, "volume%d.transport", i);
ret = dict_get_int32 (dict, key, &transport);
if (ret)
@@ -957,7 +978,8 @@ next:
#endif
gf_cli_print_number_of_bricks (type, brick_count,
dist_count, stripe_count, replica_count,
- disperse_count, redundancy_count);
+ disperse_count, redundancy_count,
+ arbiter_count);
cli_out ("Transport-type: %s",
((transport == 0)?"tcp":