RDMA/device: Check that the rename is nop under the lock
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 7 Feb 2019 05:41:47 +0000 (22:41 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 8 Feb 2019 23:56:45 +0000 (16:56 -0700)
commite3593b568a68b0e1a434b80fd6eaebfb655e839d
treeb2b2e43346a0e34c89f532399db62d265e8ad4b5
parent21a428a019c9a6d133e745b529b9bf18c1187e70
RDMA/device: Check that the rename is nop under the lock

Since another rename could be running in parallel it is safer to check
that the name is not changing inside the lock, where we already know the
device name will not change.

Fixes: d21943dd19b5 ("RDMA/core: Implement IB device rename function")
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
drivers/infiniband/core/device.c