RDS: Rewrite connection cleanup, fixing oops on rmmod
authorAndy Grover <andy.grover@oracle.com>
Wed, 1 Apr 2009 08:20:19 +0000 (08:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Apr 2009 07:52:22 +0000 (00:52 -0700)
commit745cbccac3fe8cead529a1b3358e1e86a1505bfa
tree6c865b19881dbdd64556cc1827f6966d8a646a38
parentf1cffcbfcc53b825da7d1d26244aabd8dccb24aa
RDS: Rewrite connection cleanup, fixing oops on rmmod

This fixes a bug where a connection was unexpectedly
not on *any* list while being destroyed. It also
cleans up some code duplication and regularizes some
function names.

* Grab appropriate lock in conn_free() and explain in comment
* Ensure via locking that a conn is never not on either
  a dev's list or the nodev list
* Add rds_xx_remove_conn() to match rds_xx_add_conn()
* Make rds_xx_add_conn() return void
* Rename remove_{,nodev_}conns() to
  destroy_{,nodev_}conns() and unify their implementation
  in a helper function
* Document lock ordering as nodev conn_lock before
  dev_conn_lock

Reported-by: Yosef Etigin <yosefe@voltaire.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/ib.c
net/rds/ib.h
net/rds/ib_cm.c
net/rds/ib_rdma.c
net/rds/iw.c
net/rds/iw.h
net/rds/iw_cm.c
net/rds/iw_rdma.c