RDMA/core: Change rdma_get_gid_attr returned error code
authorAvihai Horon <avihaih@nvidia.com>
Wed, 23 Sep 2020 16:50:12 +0000 (19:50 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 2 Oct 2020 00:20:11 +0000 (21:20 -0300)
commit3ff4de8f6030cbcabb918a920037721bbc38e8f5
tree729825a74b47c5d7275c4bf34f3249c21f1fe5cf
parenta4947e84f23474803b62a2759b5808147e4e15f9
RDMA/core: Change rdma_get_gid_attr returned error code

Change the error code returned from rdma_get_gid_attr when the GID entry
is invalid but the GID index is in the gid table size range to -ENODATA
instead of -EINVAL.

This change is done in order to provide a more accurate error reporting to
be used by the new GID query API in user space. Nevertheless, -EINVAL is
still returned from sysfs in the aforementioned case to maintain
compatibility with user space that expects -EINVAL.

Link: https://lore.kernel.org/r/20200923165015.2491894-2-leon@kernel.org
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/cache.c
drivers/infiniband/core/sysfs.c