summaryrefslogtreecommitdiffstats
path: root/xlators
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
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')
-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;
}