From 4a43031ce0f045b673a50159dce5316bcae825ee Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Tue, 24 Nov 2009 06:07:16 +0000 Subject: cluster/afr: Fix double-free in opendir self-heal callback. local->cont.opendir.checksum was being free'd both in the self-heal completion function and self-heal unwind. Signed-off-by: Vikas Gorur Signed-off-by: Anand V. Avati BUG: 249 (Self heal of a file that does not exist on the first subvolume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=249 --- xlators/cluster/afr/src/afr-dir-read.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index cff86cf9003..ac0663ad971 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -59,7 +59,10 @@ afr_examine_dir_completion_cbk (call_frame_t *frame, xlator_t *this) afr_set_opendir_done (this, local->fd->inode, 1); - AFR_STACK_UNWIND (opendir, sh->orig_frame, local->op_ret, + /* let self-heal's local cleanup free this */ + local->cont.opendir.checksum = NULL; + + AFR_STACK_UNWIND (opendir, frame, local->op_ret, local->op_errno, local->fd); return 0; -- cgit