IB/uverbs: Prevent reregistration of DM_MR to regular MR
authorAriel Levkovich <lariel@mellanox.com>
Thu, 26 Apr 2018 12:42:54 +0000 (15:42 +0300)
committerDoug Ledford <dledford@redhat.com>
Fri, 27 Apr 2018 18:22:24 +0000 (14:22 -0400)
commit5ccbf63f87a39c279729670d2e31166844a335c6
tree58e78361f5595303d03bcc70d34a11b463535667
parent4f9ca2d8686ecfdd40ca4f0294a3d94f83f05cea
IB/uverbs: Prevent reregistration of DM_MR to regular MR

This patch adds a check in the ib_uverbs_rereg_mr flow to make
sure there's no attempt to rereg a device memory MR to regular MR.
In such case the command will fail with -EINVAL status.

fixes: be934cca9e98 ("IB/uverbs: Add device memory registration ioctl support")
Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c