Bug 910661

Summary: fuse client crashes when open-fd migration is in progress
Product: [Community] GlusterFS Reporter: shishir gowda <sgowda>
Component: distributeAssignee: shishir gowda <sgowda>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: amarts, gluster-bugs, jdarcy, nsathyan
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 14:03:48 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 895528    
Description Flags
open-fd-test.c taken from glusterfs/extras/tests none

Description shishir gowda 2013-02-13 02:06:04 EST
Created attachment 696723 [details]
open-fd-test.c taken from glusterfs/extras/tests

Description of problem:
Fuse client crashes when a file with open-fd is in migration. Rebalance does not error out. But fuse client crashes

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

How reproducible:

Steps to Reproduce:
1. create a dht (atleast 2 bricks) volume
2. create a file
3. rename the file till a linkfile is created
4. open the file and start writing to it
5. start rebalance force

Attached the test program to keep the fd opened, and writes. (pass the file path as argument)
Actual results:
client crashes

Expected results:
client should not crash

Additional info:
Comment 1 shishir gowda 2013-02-13 02:07:23 EST
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/local/sbin/glusterfs --volfile-id=/patchy --volfile-server=localhost /mnt/'.
Program terminated with signal 11, Segmentation fault.
#0  pthread_spin_lock (lock=0xaaaaaac2) at ../nptl/sysdeps/i386/pthread_spin_lock.c:35
35	  asm ("\n"
Missing separate debuginfos, use: debuginfo-install keyutils-libs-1.5.5-2.fc17.x86_64 libgcc-4.7.2-2.fc17.x86_64 libselinux-2.1.10-3.fc17.x86_64
(gdb) bt
#0  pthread_spin_lock (lock=0xaaaaaac2) at ../nptl/sysdeps/i386/pthread_spin_lock.c:35
#1  0x00007f7567af2dd3 in fd_ref (fd=0x117108c) at fd.c:447
#2  0x00007f7566129875 in fuse_write (this=0x10c9b30, finh=0x7f7554007010, msg=0x7f756716d000)
    at fuse-bridge.c:2186
#3  0x00007f756613dd68 in fuse_thread_proc (data=0x10c9b30) at fuse-bridge.c:4562
#4  0x00000039f2c07d14 in start_thread (arg=0x7f7561f2b700) at pthread_create.c:309
#5  0x00000039f28f168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

(gdb) p *fd
$2 = {pid = 2992, flags = 32770, refcount = 0, inode_list = {next = 0x117109c, prev = 0x117109c}, 
  inode = 0xaaaaaaaa, lock = 1, _ctx = 0x7f7554006e50, xl_count = 11, lk_ctx = 0x7f75540038a0, 
  anonymous = _gf_false}
Comment 2 shishir gowda 2013-02-14 02:20:32 EST
Fix sent for review http://review.gluster.org/#change,4509
Comment 3 Vijay Bellur 2013-02-14 23:26:30 EST
CHANGE: http://review.gluster.org/4509 (cluster/distribute: Remove suprious fd_unref call) merged in master by Anand Avati (avati@redhat.com)
Comment 4 Vijay Bellur 2013-03-04 05:40:46 EST
CHANGE: http://review.gluster.org/4608 (cluster/distribute: Remove suprious fd_unref call) merged in release-3.4 by Vijay Bellur (vbellur@redhat.com)