Bug 762094 (GLUSTER-362)

Summary: GlusterFS crash while doing mkdir in stripe setup
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: stripeAssignee: Amar Tumballi <amarts>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
client log file
none
Backtrace from the core file none

Description Raghavendra Bhat 2009-11-09 03:18:49 UTC
Created attachment 94 [details]
my inputrc which has this right

Comment 1 Raghavendra Bhat 2009-11-09 03:20:19 UTC
Created attachment 95 [details]
gendiff patch to fix the described problems

Comment 2 Raghavendra Bhat 2009-11-09 06:17:59 UTC
On GlusterFS-3.0.0pre1 in striping the glusterfs client crashes whenever mkdir is encountered.The core file is in /share/bugzilla/<bugid>.The backtrace of the core file and the client log files are attached.

Comment 3 Amar Tumballi 2009-11-09 13:44:44 UTC
below patch should fix it. Can you please check with this changes made in code base?

----------
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index bd81661..f3baf98 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -493,6 +493,7 @@ stripe_stack_unwind_inode_cbk (call_frame_t *frame, void *cookie,
 {
         int32_t         callcnt = 0;
         stripe_local_t *local   = NULL;
+        inode_t       *local_inode = NULL;
 
         local = frame->local;
 
@@ -512,6 +513,8 @@ stripe_stack_unwind_inode_cbk (call_frame_t *frame, void *cookie,
  
                 if (op_ret >= 0) {
                         local->op_ret = 0;
+                        if (!local->inode)
+                                local->inode = inode_ref (inode);
 
                         if (!local->post_buf.st_blksize) {
                                 local->post_buf = *buf;
@@ -558,10 +561,14 @@ stripe_stack_unwind_inode_cbk (call_frame_t *frame, void *cookie,
                 if (local->failed)
                         local->op_ret = -1;
 
+                local_inode = local->inode;
+
                 STACK_UNWIND (frame, local->op_ret, local->op_errno, 
                               local->inode, &local->post_buf, 
                               &local->pre_parent_buf, 
                               &local->post_parent_buf);
+                if (!local_inode)
+                        inode_unref (local_inode);
         }
 
         return 0;

Comment 4 Amar Tumballi 2009-11-11 19:22:41 UTC
*** Bug 367 has been marked as a duplicate of this bug. ***

Comment 5 Anand Avati 2009-11-12 04:18:41 UTC
PATCH: http://patches.gluster.com/patch/2154 in master (cluster/stripe: Set local->inode value before referring it.)