An error occurred fetching the project authors.
  1. 25 Apr, 2013 1 commit
  2. 28 Feb, 2013 1 commit
    • Sasha Levin's avatar
      hlist: drop the node parameter from iterators · b67bfe0d
      Sasha Levin authored
      I'm not sure why, but the hlist for each entry iterators were conceived
      
              list_for_each_entry(pos, head, member)
      
      The hlist ones were greedy and wanted an extra parameter:
      
              hlist_for_each_entry(tpos, pos, head, member)
      
      Why did they need an extra pos parameter? I'm not quite sure. Not only
      they don't really need it, it also prevents the iterator from looking
      exactly like the list iterator, which is unfortunate.
      
      Besides the semantic patch, there was some manual work required:
      
       - Fix up the actual hlist iterators in linux/list.h
       - Fix up the declaration of other iterators based on the hlist ones.
       - A very small amount of places were using the 'node' parameter, this
       was modified to use 'obj->member' instead.
       - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
       properly, so those had to be fixed up manually.
      
      The semantic patch which is mostly the work of Peter Senna Tschudin is here:
      
      @@
      iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;
      
      type T;
      expression a,c,d,e;
      identifier b;
      statement S;
      @@
      
      -T b;
          <+... when != b
      (
      hlist_for_each_entry(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue(a,
      - b,
      c) S
      |
      hlist_for_each_entry_from(a,
      - b,
      c) S
      |
      hlist_for_each_entry_rcu(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_rcu_bh(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue_rcu_bh(a,
      - b,
      c) S
      |
      for_each_busy_worker(a, c,
      - b,
      d) S
      |
      ax25_uid_for_each(a,
      - b,
      c) S
      |
      ax25_for_each(a,
      - b,
      c) S
      |
      inet_bind_bucket_for_each(a,
      - b,
      c) S
      |
      sctp_for_each_hentry(a,
      - b,
      c) S
      |
      sk_for_each(a,
      - b,
      c) S
      |
      sk_for_each_rcu(a,
      - b,
      c) S
      |
      sk_for_each_from
      -(a, b)
      +(a)
      S
      + sk_for_each_from(a) S
      |
      sk_for_each_safe(a,
      - b,
      c, d) S
      |
      sk_for_each_bound(a,
      - b,
      c) S
      |
      hlist_for_each_entry_safe(a,
      - b,
      c, d, e) S
      |
      hlist_for_each_entry_continue_rcu(a,
      - b,
      c) S
      |
      nr_neigh_for_each(a,
      - b,
      c) S
      |
      nr_neigh_for_each_safe(a,
      - b,
      c, d) S
      |
      nr_node_for_each(a,
      - b,
      c) S
      |
      nr_node_for_each_safe(a,
      - b,
      c, d) S
      |
      - for_each_gfn_sp(a, c, d, b) S
      + for_each_gfn_sp(a, c, d) S
      |
      - for_each_gfn_indirect_valid_sp(a, c, d, b) S
      + for_each_gfn_indirect_valid_sp(a, c, d) S
      |
      for_each_host(a,
      - b,
      c) S
      |
      for_each_host_safe(a,
      - b,
      c, d) S
      |
      for_each_mesh_entry(a,
      - b,
      c, d) S
      )
          ...+>
      
      [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
      [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
      [akpm@linux-foundation.org: checkpatch fixes]
      [akpm@linux-foundation.org: fix warnings]
      [akpm@linux-foudnation.org: redo intrusive kvm changes]
      Tested-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b67bfe0d
  3. 11 Jan, 2013 2 commits
  4. 13 Dec, 2012 1 commit
    • Yi Zou's avatar
      target/tcm_fc: fix the lockdep warning due to inconsistent lock state · 9f4ad44b
      Yi Zou authored
      The lockdep warning below is in theory correct but it will be in really weird
      rare situation that ends up that deadlock since the tcm fc session is hashed
      based the rport id. Nonetheless, the complaining below is about rcu callback
      that does the transport_deregister_session() is happening in softirq, where
      transport_register_session() that happens earlier is not. This triggers the
      lockdep warning below. So, just fix this to make lockdep happy by disabling
      the soft irq before calling transport_register_session() in ft_prli.
      
      BTW, this was found in FCoE VN2VN over two VMs, couple of create and destroy
      would get this triggered.
      
      v1: was enforcing register to be in softirq context which was not righ. See,
      http://www.spinics.net/lists/target-devel/msg03614.html
      
      v2: following comments from Roland&Nick (thanks), it seems we don't have to
      do transport_deregister_session() in rcu callback, so move it into ft_sess_free()
      but still do kfree() of the corresponding ft_sess struct in rcu callback to
      make sure the ft_sess is not freed till the rcu callback.
      
      ...
      [ 1328.370592] scsi2 : FCoE Driver
      [ 1328.383429] fcoe: No FDMI support.
      [ 1328.384509] host2: libfc: Link up on port (000000)
      [ 1328.934229] host2: Assigned Port ID 00a292
      [ 1357.232132] host2: rport 00a393: Remove port
      [ 1357.232568] host2: rport 00a393: Port sending LOGO from Ready state
      [ 1357.233692] host2: rport 00a393: Delete port
      [ 1357.234472] host2: rport 00a393: work event 3
      [ 1357.234969] host2: rport 00a393: callback ev 3
      [ 1357.235979] host2: rport 00a393: Received a LOGO response closed
      [ 1357.236706] host2: rport 00a393: work delete
      [ 1357.237481]
      [ 1357.237631] =================================
      [ 1357.238064] [ INFO: inconsistent lock state ]
      [ 1357.238450] 3.7.0-rc7-yikvm+ #3 Tainted: G           O
      [ 1357.238450] ---------------------------------
      [ 1357.238450] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
      [ 1357.238450] ksoftirqd/0/3 [HC0[0]:SC1[1]:HE0:SE0] takes:
      [ 1357.238450]  (&(&se_tpg->session_lock)->rlock){+.?...}, at: [<ffffffffa01eacd4>] transport_deregister_session+0x41/0x148 [target_core_mod]
      [ 1357.238450] {SOFTIRQ-ON-W} state was registered at:
      [ 1357.238450]   [<ffffffff810834f5>] mark_held_locks+0x6d/0x95
      [ 1357.238450]   [<ffffffff8108364a>] trace_hardirqs_on_caller+0x12d/0x197
      [ 1357.238450]   [<ffffffff810836c1>] trace_hardirqs_on+0xd/0xf
      [ 1357.238450]   [<ffffffff8149caba>] _raw_spin_unlock_irq+0x2d/0x45
      [ 1357.238450]   [<ffffffffa01e8d10>] __transport_register_session+0xb8/0x122 [target_core_mod]
      [ 1357.238450]   [<ffffffffa01e8dbe>] transport_register_session+0x44/0x5a [target_core_mod]
      [ 1357.238450]   [<ffffffffa018e32c>] ft_prli+0x1e3/0x275 [tcm_fc]
      [ 1357.238450]   [<ffffffffa0160e8d>] fc_rport_recv_req+0x95e/0xdc5 [libfc]
      [ 1357.238450]   [<ffffffffa015be88>] fc_lport_recv_els_req+0xc4/0xd5 [libfc]
      [ 1357.238450]   [<ffffffffa015c778>] fc_lport_recv_req+0x12f/0x18f [libfc]
      [ 1357.238450]   [<ffffffffa015a6d7>] fc_exch_recv+0x8ba/0x981 [libfc]
      [ 1357.238450]   [<ffffffffa0176d7a>] fcoe_percpu_receive_thread+0x47a/0x4e2 [fcoe]
      [ 1357.238450]   [<ffffffff810549f1>] kthread+0xb1/0xb9
      [ 1357.238450]   [<ffffffff814a40ec>] ret_from_fork+0x7c/0xb0
      [ 1357.238450] irq event stamp: 275411
      [ 1357.238450] hardirqs last  enabled at (275410): [<ffffffff810bb6a0>] rcu_process_callbacks+0x229/0x42a
      [ 1357.238450] hardirqs last disabled at (275411): [<ffffffff8149c2f7>] _raw_spin_lock_irqsave+0x22/0x8e
      [ 1357.238450] softirqs last  enabled at (275394): [<ffffffff8103d669>] __do_softirq+0x246/0x26f
      [ 1357.238450] softirqs last disabled at (275399): [<ffffffff8103d6bb>] run_ksoftirqd+0x29/0x62
      [ 1357.238450]
      [ 1357.238450] other info that might help us debug this:
      [ 1357.238450]  Possible unsafe locking scenario:
      [ 1357.238450]
      [ 1357.238450]        CPU0
      [ 1357.238450]        ----
      [ 1357.238450]   lock(&(&se_tpg->session_lock)->rlock);
      [ 1357.238450]   <Interrupt>
      [ 1357.238450]     lock(&(&se_tpg->session_lock)->rlock);
      [ 1357.238450]
      [ 1357.238450]  *** DEADLOCK ***
      [ 1357.238450]
      [ 1357.238450] no locks held by ksoftirqd/0/3.
      [ 1357.238450]
      [ 1357.238450] stack backtrace:
      [ 1357.238450] Pid: 3, comm: ksoftirqd/0 Tainted: G           O 3.7.0-rc7-yikvm+ #3
      [ 1357.238450] Call Trace:
      [ 1357.238450]  [<ffffffff8149399a>] print_usage_bug+0x1f5/0x206
      [ 1357.238450]  [<ffffffff8100da59>] ? save_stack_trace+0x2c/0x49
      [ 1357.238450]  [<ffffffff81082aae>] ? print_irq_inversion_bug.part.14+0x1ae/0x1ae
      [ 1357.238450]  [<ffffffff81083336>] mark_lock+0x106/0x258
      [ 1357.238450]  [<ffffffff81084e34>] __lock_acquire+0x2e7/0xe53
      [ 1357.238450]  [<ffffffff8102903d>] ? pvclock_clocksource_read+0x48/0xb4
      [ 1357.238450]  [<ffffffff810ba6a3>] ? rcu_process_gp_end+0xc0/0xc9
      [ 1357.238450]  [<ffffffffa01eacd4>] ? transport_deregister_session+0x41/0x148 [target_core_mod]
      [ 1357.238450]  [<ffffffff81085ef1>] lock_acquire+0x119/0x143
      [ 1357.238450]  [<ffffffffa01eacd4>] ? transport_deregister_session+0x41/0x148 [target_core_mod]
      [ 1357.238450]  [<ffffffff8149c329>] _raw_spin_lock_irqsave+0x54/0x8e
      [ 1357.238450]  [<ffffffffa01eacd4>] ? transport_deregister_session+0x41/0x148 [target_core_mod]
      [ 1357.238450]  [<ffffffffa01eacd4>] transport_deregister_session+0x41/0x148 [target_core_mod]
      [ 1357.238450]  [<ffffffff810bb6a0>] ? rcu_process_callbacks+0x229/0x42a
      [ 1357.238450]  [<ffffffffa018ddc5>] ft_sess_rcu_free+0x17/0x24 [tcm_fc]
      [ 1357.238450]  [<ffffffffa018ddae>] ? ft_sess_free+0x1b/0x1b [tcm_fc]
      [ 1357.238450]  [<ffffffff810bb6d7>] rcu_process_callbacks+0x260/0x42a
      [ 1357.238450]  [<ffffffff8103d55d>] __do_softirq+0x13a/0x26f
      [ 1357.238450]  [<ffffffff8149b34e>] ? __schedule+0x65f/0x68e
      [ 1357.238450]  [<ffffffff8103d6bb>] run_ksoftirqd+0x29/0x62
      [ 1357.238450]  [<ffffffff8105c83c>] smpboot_thread_fn+0x1a5/0x1aa
      [ 1357.238450]  [<ffffffff8105c697>] ? smpboot_unregister_percpu_thread+0x47/0x47
      [ 1357.238450]  [<ffffffff810549f1>] kthread+0xb1/0xb9
      [ 1357.238450]  [<ffffffff8149b49d>] ? wait_for_common+0xbb/0x10a
      [ 1357.238450]  [<ffffffff81054940>] ? __init_kthread_worker+0x59/0x59
      [ 1357.238450]  [<ffffffff814a40ec>] ret_from_fork+0x7c/0xb0
      [ 1357.238450]  [<ffffffff81054940>] ? __init_kthread_worker+0x59/0x59
      [ 1417.440099]  rport-2:0-0: blocked FC remote port time out: removing rport
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Cc: Open-FCoE <devel@open-fcoe.org>
      Cc: Nicholas A. Bellinger <nab@risingtidesystems.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      9f4ad44b
  5. 18 Sep, 2012 1 commit
  6. 20 Aug, 2012 1 commit
  7. 06 Jul, 2012 1 commit
  8. 16 Mar, 2012 1 commit
  9. 10 Mar, 2012 1 commit
  10. 21 Feb, 2012 1 commit
  11. 14 Dec, 2011 1 commit
  12. 11 Oct, 2011 1 commit
  13. 15 Sep, 2011 1 commit
  14. 22 Jul, 2011 1 commit
    • Andy Grover's avatar
      target: Follow up core updates from AGrover and HCH (round 4) · 6708bb27
      Andy Grover authored
      This patch contains the squashed version of forth round series cleanups
      from Andy and Christoph following the post heavy lifting in the preceeding:
      'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
      changes.  This also includes a conversion of target core and the v3.0
      mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
      CONFIG_DYNAMIC_DEBUG infrastructure!
      
      These have been squashed into this third and final round for v3.1.
      
      target: Remove ifdeffed code in t_g_process_write
      target: Remove direct ramdisk code
      target: Rename task_sg_num to task_sg_nents
      target: Remove custom debug macros for pr_debug. Use pr_err().
      target: Remove custom debug macros in mainline fabrics
      target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
      target: Remove transport do_se_mem_map callback
      target: Further simplify transport_free_pages
      target: Redo task allocation return value handling
      target: Remove extra parentheses
      target: change alloc_task call to take *cdb, not *cmd
      
      (nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      6708bb27
  15. 24 Jun, 2011 2 commits
  16. 20 Jun, 2011 1 commit
  17. 17 May, 2011 1 commit
    • Kiran Patil's avatar
      [SCSI] tcm_fc: Adding FC_FC4 provider (tcm_fc) for FCoE target (TCM - target core) support · 3699d92a
      Kiran Patil authored
      This is a comprehensive patch for FC-FC4 provider. tcm_fc is a FC-FC4
      provider which glues target core (TCM) with Fiber channel library
      (libfc). tcm_fc uses existing FC4 provider hooks from Fiber channel
      library. This Fiber channel library is used by FCoE (transport - FC
      over Ethernet) protocol driver as well.
      
      Combination of modules such as Fiber channel library, tcm_fc, TCM
      target core, and FCoE protocol driver enables functional FCoE target.
      
      This patch includes initial commit for tcm_fc plus additional
      enhancement, bug fixes.
      
      This tcm_fc module essentially contains 3 entry points such as "prli",
      "prlo", "recv".  When process login request (ELS_PRLI) request is
      received, Fiber channel library (libfc) module calls passive providers
      (FC-FC4, tcm_fc) (if any registered) "prli" function. Likewise when
      LOGO request is received, "prlo" function of passive provider is
      invoked by libfc.  For all other request (e.g. any read/write, task
      management, LUN inquiry commands), "recv" function of passiver
      provider is invoked by libfc. Those passive providers "prli, prlo,
      recv" functions interact with TCM target core for requested operation.
      
      This module was primarily developed by "Joe Eykholt" and there were
      significant contributions from the people listed under signed-off.
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: default avatarKiran Patil <kiran.patil@intel.com>
      Acked-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <jbottomley@parallels.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      3699d92a