Bug 913544

Summary: stub unwind of ftruncate leads to crash
Product: [Community] GlusterFS Reporter: Pranith Kumar K <pkarampu>
Component: coreAssignee: Pranith Kumar K <pkarampu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: amarts, gluster-bugs, jdarcy
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 13:50:19 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Pranith Kumar K 2013-02-21 07:50:27 EST
Description of problem:
#0  0x00007f0f5b044e80 in fuse_truncate_cbk (frame=0x7f0f5b8898b4, cookie=0x7f0f5ba970f8, this=0x245eca0, op_ret=-1, op_errno=5, 
    prebuf=0x7f0f5b4db64c, postbuf=0x0, xdata=0x0) at fuse-bridge.c:579
#1  0x00007f0f535be591 in io_stats_ftruncate_cbk (frame=0x7f0f5ba970f8, cookie=0x7f0f5ba971a4, this=0x248c410, op_ret=-1, op_errno=5, 
    prebuf=0x7f0f5b4db64c, postbuf=0x0, xdata=0x0) at io-stats.c:1710
#2  0x00007f0f537d2590 in mdc_ftruncate_cbk (frame=0x7f0f5ba971a4, cookie=0x7f0f5ba97704, this=0x248b260, op_ret=-1, op_errno=5, 
    prebuf=0x7f0f5b4db64c, postbuf=0x0, xdata=0x0) at md-cache.c:931
#3  0x00007f0f5cc9bd16 in call_resume_unwind (stub=0x7f0f5b4db04c) at call-stub.c:2491
#4  0x00007f0f5cc9e17c in call_unwind_error (stub=0x7f0f5b4db04c, op_ret=-1, op_errno=5) at call-stub.c:2668
#5  0x00007f0f539df1fd in ob_wake_cbk (frame=0x7f0f5b88a0f0, cookie=0x7f0f5ba975ac, this=0x248a0a0, op_ret=-1, op_errno=5, 
    fd_ret=0x24ef588, xdata=0x0) at open-behind.c:162
#6  0x00007f0f5cc78bc6 in default_open_cbk (frame=0x7f0f5ba975ac, cookie=0x7f0f5ba973a8, this=0x2488eb0, op_ret=-1, op_errno=5, 
    fd=0x24ef588, xdata=0x0) at defaults.c:193

(gdb) fr 3
#3  0x00007f0f5cc9bd16 in call_resume_unwind (stub=0x7f0f5b4db04c) at call-stub.c:2491
2491			STUB_UNWIND (stub, fstat, &stub->args_cbk.stat,

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. create a plain replicate volume
2. on Mount touch a
3. in the backend dd the files with 1M, 2M on each replica respectively to simulate a open failure.
4. do truncate -s 0 a on the mount point
Actual results:
this lead to crash of the mount point.

Expected results:
truncate should have failed with Input/Output error.

Additional info:
Comment 1 Vijay Bellur 2013-02-21 09:19:06 EST
CHANGE: http://review.gluster.org/4564 (call-stub: remove fall-through in ftruncate) merged in master by Vijay Bellur (vbellur@redhat.com)
Comment 2 Anand Avati 2013-09-05 11:24:46 EDT
REVIEW: http://review.gluster.org/5827 (call-stub: remove fall-through in ftruncate) posted (#1) for review on release-3.4 by Raghavendra Bhat (raghavendra@redhat.com)
Comment 3 Anand Avati 2013-09-05 22:26:26 EDT
COMMIT: http://review.gluster.org/5827 committed in release-3.4 by Vijay Bellur (vbellur@redhat.com) 
commit 06d2e2a93f00550eaac68ce0f731e8ffa8850c79
Author: Raghavendra Bhat <raghavendra@redhat.com>
Date:   Thu Sep 5 20:53:14 2013 +0530

    call-stub: remove fall-through in ftruncate
    Original-author: Pranith Kumar K <pkarampu@redhat.com>
    Change-Id: I7c8ed3e3e4ddc558ff061f2e1407fb43095e67f4
    BUG: 913544
    Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
    Reviewed-on: http://review.gluster.org/5827
    Reviewed-by: Vijay Bellur <vbellur@redhat.com>
    Tested-by: Gluster Build System <jenkins@build.gluster.com>