From 475efecfba7194c598a94879852bcd37ac2deb5d Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 25 Jul 2012 08:14:38 -0400 Subject: cluster: fix crash on link of named pipe in stripe/replicate vol A crash occurs when attempting to link a named pipe on a striped, replicated volume. The cause for this crash is attempting to deref a NULL inode pointer in stripe_link_cbk(). The RCA for this bug uncovered a couple of problems: - AFR ignores the inode pointer it receives on failure (returning NULL). - stripe assumes the inode pointer is valid on failure. Either one of these changes addresses the crash, but this patch includes both changes. AFR is modified to pass along the inode pointer it receives (which could still be NULL). stripe is modified to not assume the inode pointer is valid on fop failure. BUG: 842825 Change-Id: I368849b7cfbb137a08ae5f89d26406814ff5bb09 Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.com/3790 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-dir-write.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'xlators/cluster/afr/src') diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index b7e9bd8748a..46f5dceebd4 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -862,13 +862,12 @@ afr_link_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->cont.link.postparent = *postparent; } - local->cont.link.inode = inode; - fresh_children = local->fresh_children; fresh_children[local->success_count] = child_index; local->success_count++; } + local->cont.link.inode = inode; local->op_errno = op_errno; } UNLOCK (&frame->lock); -- cgit