summaryrefslogtreecommitdiffstats
path: root/xlators/features/read-only/src/worm.c
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-03-06 10:19:54 -0500
committerJeff Darcy <jeff@pl.atyp.us>2017-07-11 15:01:51 +0000
commit9ab249130a5dd442044e787f1e171e7a17839906 (patch)
treee5a5dc92b211701a19ce1a787ab69f5a68814c46 /xlators/features/read-only/src/worm.c
parent09f9c6c1c9c565d54c257e58c46004326ec1c495 (diff)
features/read-only: Allow internal clients to r/w
If the "read-only" volume option is set, it would make the volume "read-only". But it also makes it read-only to gluster internal clients such as gsyncd, self heal, bitd, rebalance etc. In which case, all the internal operations would fail. This patch allows internal clients to read and write when "read-only" option is set. Change-Id: I8110e8d9eac8def403bb29f235000ddc79eaa433 BUG: 1430608 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: https://review.gluster.org/16855 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Karthik U S <ksubrahm@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/features/read-only/src/worm.c')
-rw-r--r--xlators/features/read-only/src/worm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c
index 0f481ec766a..74bf0072e4c 100644
--- a/xlators/features/read-only/src/worm.c
+++ b/xlators/features/read-only/src/worm.c
@@ -34,7 +34,7 @@ static int32_t
worm_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
fd_t *fd, dict_t *xdata)
{
- if (is_readonly_or_worm_enabled (this) &&
+ if (is_readonly_or_worm_enabled (frame, this) &&
(flags & (O_WRONLY | O_RDWR | O_APPEND | O_TRUNC))) {
STACK_UNWIND_STRICT (open, frame, -1, EROFS, NULL, NULL);
return 0;
@@ -55,7 +55,7 @@ worm_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
priv = this->private;
GF_ASSERT (priv);
- if (is_readonly_or_worm_enabled (this))
+ if (is_readonly_or_worm_enabled (frame, this))
goto out;
if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
@@ -91,7 +91,7 @@ worm_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
priv = this->private;
GF_ASSERT (priv);
- if (is_readonly_or_worm_enabled (this)) {
+ if (is_readonly_or_worm_enabled (frame, this)) {
goto out;
}
if (!priv->worm_file || (frame->root->pid < 0)) {
@@ -127,7 +127,7 @@ worm_rename (call_frame_t *frame, xlator_t *this,
priv = this->private;
GF_ASSERT (priv);
- if (is_readonly_or_worm_enabled (this))
+ if (is_readonly_or_worm_enabled (frame, this))
goto out;
if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
@@ -163,7 +163,7 @@ worm_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
priv = this->private;
GF_ASSERT (priv);
- if (is_readonly_or_worm_enabled (this))
+ if (is_readonly_or_worm_enabled (frame, this))
goto out;
if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;
@@ -198,7 +198,7 @@ worm_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
priv = this->private;
GF_ASSERT (priv);
- if (is_readonly_or_worm_enabled (this))
+ if (is_readonly_or_worm_enabled (frame, this))
goto out;
if (!priv->worm_file || (frame->root->pid < 0)) {
op_errno = 0;