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: always 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:
[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}
Fix sent for review http://review.gluster.org/#change,4509
CHANGE: http://review.gluster.org/4509 (cluster/distribute: Remove suprious fd_unref call) merged in master by Anand Avati (avati)
CHANGE: http://review.gluster.org/4608 (cluster/distribute: Remove suprious fd_unref call) merged in release-3.4 by Vijay Bellur (vbellur)