From c1e61fd5dfd118830e896a45d398a2041006d74e Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 13 Apr 2017 11:38:08 +0530 Subject: worm: add check for internal processes in ftruncate() The patch fixes the recently seen issues with worm_sh.t test. RCA: - $ git log --oneline xlators/features/read-only/src/worm.c 1b01bdc worm: allow Self-heal-Daemon to perform some operations c5a4a77 features/worm: Adding implementation for ftruncate - These two patches were merged in reverse order of their submission, and hence the check added for internal processes got missed in new fop 'ftruncate()'. The worm_sh.t passed the tests as while that patch got submitted there was no ftruncate() in worm xlator. Change-Id: I81a8a45fa2679917a2c859c4f5224a2c3edbc784 BUG: 1423413 Signed-off-by: Amar Tumballi Reviewed-on: https://review.gluster.org/17048 NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Zhou Zhengping Reviewed-by: David Spisla Reviewed-by: Vijay Bellur --- xlators/features/read-only/src/worm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c index 9a956ccd873..0f481ec766a 100644 --- a/xlators/features/read-only/src/worm.c +++ b/xlators/features/read-only/src/worm.c @@ -200,7 +200,7 @@ worm_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, 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; } -- cgit