linux-sg2042/drivers/infiniband/ulp/isert
Raju Rangoju 63b268d232 IB/isert: Properly release resources on DEVICE_REMOVAL
When the low level driver exercises the hot unplug they would call
rdma_cm cma_remove_one which would fire DEVICE_REMOVAL event to all cma
consumers. Now, if consumer doesn't make sure they destroy all IB
objects created on that IB device instance prior to finalizing all
processing of DEVICE_REMOVAL callback, rdma_cm will let the lld to
de-register with IB core and destroy the IB device instance. And if the
consumer calls (say) ib_dereg_mr(), it will crash since that dev object
is NULL.

In the current implementation, iser-target just initiates the cleanup
and returns from DEVICE_REMOVAL callback. This deferred work creates a
race between iser-target cleaning IB objects(say MR) and lld destroying
IB device instance.

This patch includes the following fixes
  -> make sure that consumer frees all IB objects associated with device
     instance
  -> return non-zero from the callback to destroy the rdma_cm id

Signed-off-by: Raju Rangoju <rajur@chelsio.com>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-09-02 13:46:32 -04:00
..
Kconfig treewide: Fix typo in Kconfig 2013-10-14 15:23:02 +02:00
Makefile iser-target: Add iSCSI Extensions for RDMA (iSER) target driver 2013-04-25 01:09:41 -07:00
ib_isert.c IB/isert: Properly release resources on DEVICE_REMOVAL 2016-09-02 13:46:32 -04:00
ib_isert.h IB/isert: Properly release resources on DEVICE_REMOVAL 2016-09-02 13:46:32 -04:00