Commit: 4f38cdcb1cdc1edab2d2ed3392ad39c1ee75becd
https://github.com/zfs-linux/zfs/commit/4f38cdcb1cdc1edab2d2ed3392ad39c1ee75becd
Author: Prasad Joshi <pra...@kqinfotech.com>
Date: 2011-05-10 (Tue, 10 May 2011)
Changed paths:
M include/sys/zfs_rlock.h
M module/zfs/zfs_rlock.c
Log Message:
-----------
Use link list to maintain a list of range variables to be released
do_delayed_release can result in releasing the
condition variable while reference is still being
held in range lock. The function is completely
removed and instead a list of range variables to
be released is maintained. The range variables in
the list are freed after releaseing the range
lock. The patch fixes the kernel panic bug
reported by Curley-Joe.
[17291.729503] Process nfsd (pid: 5564, threadinfo ffff8800c669e000, task ffff8800ef2ac5c0)
[17291.729505] Stack:
[17291.729507] ffff8800c669f750 ffffffff811090d7 ffff8800c648a890 9595959595959595
[17291.729513] <0> ffff8800c648a8b0 ffff8800c648a890 ffff88009abc0a00 0000000000000f70
[17291.729520] <0> ffff8800c669f770 ffffffffa026fec0 ffff8800c669f770 ffff8800555e5a38
[17291.729527] Call Trace:
[17291.729533] [<ffffffff811090d7>] kfree+0x5a/0xd7
[17291.729549] [<ffffffffa026fec0>] kmem_free_debug+0x28/0x2d [spl]
[17291.729562] [<ffffffffa0274ae8>] __cv_destroy+0x2c/0x43 [spl]
[17291.729616] [<ffffffffa03606ea>] release_rl+0x38/0x49 [zfs]
[17291.729657] [<ffffffffa0360721>] do_delayed_release+0x26/0x28 [zfs]
[17291.729698] [<ffffffffa0360e07>] zfs_range_lock+0x4d9/0x504 [zfs]
[17291.729740] [<ffffffffa036798b>] zfs_write+0x2e1/0x915 [zfs]
[17291.729747] [<ffffffff81078539>] ? __raw_local_irq_save+0x1d/0x23
[17291.729786] [<ffffffffa0332004>] ? sa_lookup_impl+0x13/0x15 [zfs]
[17291.729792] [<ffffffff81469681>] ? _cond_resched+0xe/0x22
[17291.729797] [<ffffffff81469dc6>] ? mutex_lock+0x29/0x50
[17291.729801] [<ffffffff8146abe6>] ? _raw_spin_lock+0xe/0x10
[17291.729809] [<ffffffffa03f4c6e>] lzfs_write+0x88/0xb4 [lzfs]
[17291.729816] [<ffffffffa03f67cd>] lzfs_vnop_write+0x8f/0x25a [lzfs]
[17291.729822] [<ffffffff81117da2>] do_loop_readv_writev+0x41/0x79
[17291.729828] [<ffffffffa03f673e>] ? lzfs_vnop_write+0x0/0x25a [lzfs]
[17291.729833] [<ffffffff81117f88>] do_readv_writev+0xb7/0x127
[17291.729850] [<ffffffffa01d0ea1>] ? put_cred+0x16/0x26 [nfsd]
[17291.729862] [<ffffffffa01d10a6>] ? nfsd_setuser+0x1b7/0x1d9 [nfsd]
[17291.729868] [<ffffffff8103c195>] ? need_resched+0x23/0x2d
[17291.729873] [<ffffffff8103c1ad>] ? should_resched+0xe/0x2e
[17291.729877] [<ffffffff81469681>] ? _cond_resched+0xe/0x22
[17291.729881] [<ffffffff81469dc6>] ? mutex_lock+0x29/0x50
[17291.729891] [<ffffffffa01cacea>] ? nfsd_setuser_and_check_port+0x7c/0x9f [nfsd]
[17291.729896] [<ffffffff8111803d>] vfs_writev+0x45/0x47
[17291.729906] [<ffffffffa01cbe6d>] nfsd_vfs_write.clone.6+0x133/0x342 [nfsd]
[17291.729911] [<ffffffff811160f6>] ? dentry_open+0x89/0x91
[17291.729922] [<ffffffffa01ccb42>] ? nfsd_open+0x163/0x172 [nfsd]
[17291.729933] [<ffffffffa01cd7da>] nfsd_write+0xd1/0xef [nfsd]
[17291.729946] [<ffffffffa01d3d26>] nfsd3_proc_write+0xd2/0xee [nfsd]
[17291.729956] [<ffffffffa01c880b>] nfsd_dispatch+0xf1/0x1cc [nfsd]
[17291.729977] [<ffffffffa0155054>] svc_process_common+0x2b4/0x4b6 [sunrpc]
[17291.729992] [<ffffffffa015547d>] svc_process+0x126/0x13a [sunrpc]
[17291.730001] [<ffffffffa01c80f6>] nfsd+0xf6/0x13f [nfsd]
[17291.730010] [<ffffffffa01c8000>] ? nfsd+0x0/0x13f [nfsd]
[17291.730015] [<ffffffff81066595>] kthread+0x7f/0x87
[17291.730021] [<ffffffff8100aae4>] kernel_thread_helper+0x4/0x10
[17291.730025] [<ffffffff81066516>] ? kthread+0x0/0x87
[17291.730030] [<ffffffff8100aae0>] ? kernel_thread_helper+0x0/0x10
[17291.730032] Code: 02 00 00 0f 4f c2 c9 c3 55 48 89 e5 0f 1f 44 00 00 e8 50 e1
f2 ff 48 c1 e8 0c 48 ba 00 00 00 00 00 ea ff ff 48 6b c0 38
48 01 d0 <48> 8b 10 80 e6 80 74 04 48 8b 40 10 c9 c3 55 48
89 e5 41 57 41
[17291.730087] RIP [<ffffffff81107a15>] virt_to_head_page+0x23/0x31
Tested-by: Shrirang <shri...@kqinfotech.com>
Signed-off-by: Prasad <pra...@kqinfotech.com>