diff options
author | Jack Morgenstein <jackm@mellanox.co.il> | 2006-08-03 10:56:42 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-08-03 10:56:42 -0700 |
commit | fd60ae404f104f12369e654af9cf03b1f1047661 (patch) | |
tree | 81fcc683f41936597e62cdba254b89ab569e5526 /drivers/infiniband/core/uverbs.h | |
parent | 8ddc7c5326064434048ec1ecfe57659e08345cc1 (diff) | |
download | blackbird-op-linux-fd60ae404f104f12369e654af9cf03b1f1047661.tar.gz blackbird-op-linux-fd60ae404f104f12369e654af9cf03b1f1047661.zip |
IB/uverbs: Avoid a crash on device hot remove
Wait until all users have closed their device context before allowing
device unregistration to complete. This prevents a crash caused by
referring to stale data structures.
A better solution would be to have a way to revoke contexts rather
than waiting for userspace to close the context, but that's a much
bigger change that will have to wait. For now let's at least avoid
the crash.
Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs.h')
-rw-r--r-- | drivers/infiniband/core/uverbs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h index bb9bee56a824..102a59c033ff 100644 --- a/drivers/infiniband/core/uverbs.h +++ b/drivers/infiniband/core/uverbs.h @@ -42,6 +42,7 @@ #include <linux/kref.h> #include <linux/idr.h> #include <linux/mutex.h> +#include <linux/completion.h> #include <rdma/ib_verbs.h> #include <rdma/ib_user_verbs.h> @@ -69,6 +70,7 @@ struct ib_uverbs_device { struct kref ref; + struct completion comp; int devnum; struct cdev *dev; struct class_device *class_dev; |