From 1b01bdcc8effb9b5342edbe669b9e2b2c36bfc80 Mon Sep 17 00:00:00 2001 From: David Spisla Date: Fri, 17 Feb 2017 13:06:44 +0100 Subject: 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 Reviewed-on: https://review.gluster.org/16661 Tested-by: jiffin tony Thottan NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos Smoke: Gluster Build System Reviewed-by: jiffin tony Thottan Reviewed-by: Amar Tumballi --- xlators/features/read-only/src/worm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xlators/features') 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; } -- cgit