From 2381497291e70d6d32a934c0f63836c80f6e3816 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 13 Aug 2013 18:39:14 +0000 Subject: [PATCH] fcst: Suppress a lockdep complaint =============================== [ INFO: suspicious RCU usage. ] 3.10.0-rc1-debug+ #1 Tainted: G O ------------------------------- fcst/ft_sess.c:194 suspicious rcu_dereference_protected() usage! other info that might help us debug this: rcu_scheduler_active = 1, debug_locks = 0 1 lock held by fcoethread/2/7942: #0: (rcu_read_lock){.+.+..}, at: [] rcu_lock_acquire.constprop.14+0x0/0x30 [fcst] stack backtrace: CPU: 2 PID: 7942 Comm: fcoethread/2 Tainted: G O 3.10.0-rc1-debug+ #1 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007 0000000000000001 ffff88003b191c28 ffffffff81525a11 ffff88003b191c58 ffffffff810a20ad ffff880039b7d1e8 ffff88003690c400 000000000000067a ffff880039b7cb88 ffff88003b191c80 ffffffffa035f67b ffff880039b7cb88 Call Trace: [] dump_stack+0x19/0x1b [] lockdep_rcu_suspicious+0xfd/0x130 [] ft_sess_get.isra.7+0x12b/0x150 [fcst] [] ft_recv+0x42/0x100 [fcst] [] fc_lport_recv_req+0x272/0x2f0 [libfc] [] fc_exch_recv+0x61b/0xdc0 [libfc] [] fcoe_percpu_receive_thread+0x386/0x5f0 [fcoe] [] kthread+0xdb/0xe0 [] ret_from_fork+0x7c/0xb0 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4962 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/ft_sess.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fcst/ft_sess.c b/fcst/ft_sess.c index ed1687a7a..c696b6435 100644 --- a/fcst/ft_sess.c +++ b/fcst/ft_sess.c @@ -205,7 +205,11 @@ static struct ft_sess *ft_sess_get(struct fc_lport *lport, u32 port_id) struct ft_sess *sess; rcu_read_lock(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) + tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP], true); +#else tport = rcu_dereference(lport->prov[FC_TYPE_FCP]); +#endif if (!tport) goto out;