From c2a7a22bfe18316eab441d49e515726e53f74582 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 20 Jul 2012 15:49:42 +0530 Subject: cluster/afr: Filter O_TRUNC in afr-fix-open RCA: When open was done while a brick is down, afr opens the file after the brick comes backup. If this happens after the self-heal on the file is completed by self-heald etc, the file will end up in truncated state. Fix: Filter O_TRUNC while afr-fix-open because afr_open turns O_TRUNC into truncate transaction, so there will be pending changelog for the subvolume on which open fails. Testing: Had to simulate the race by stopping fix-open until self-heald completes self-heal on the file after brick online. Change-Id: I32759cc37f4bb34f206d01606a279f17b246dba4 BUG: 841840 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3705 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr-open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c index 35090d80e4b..c0be197f212 100644 --- a/xlators/cluster/afr/src/afr-open.c +++ b/xlators/cluster/afr/src/afr-open.c @@ -429,7 +429,8 @@ afr_fix_open (call_frame_t *frame, xlator_t *this, afr_fd_ctx_t *fd_ctx, (void *)(long) i, priv->children[i], priv->children[i]->fops->open, - &open_local->loc, fd_ctx->flags, + &open_local->loc, + fd_ctx->flags & (~O_TRUNC), open_local->fd, NULL); } -- cgit