RDMA/uverbs: Use an unambiguous errno for method not supported
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 25 Jan 2018 02:58:34 +0000 (19:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:02:12 +0000 (11:02 +0200)
commit19b3638ce46065936c2092c983227ae7f2161220
tree7eac82d452cb10e133c84babc72cfdbc04a6e3eb
parent827aab45cb16862083415abdb3e56313d59c347e
RDMA/uverbs: Use an unambiguous errno for method not supported

[ Upstream commit 3624a8f02568f08aef299d3b117f2226f621177d ]

Returning EOPNOTSUPP is problematic because it can also be
returned by the method function, and we use it in quite a few
places in drivers these days.

Instead, dedicate EPROTONOSUPPORT to indicate that the ioctl framework
is enabled but the requested object and method are not supported by
the kernel. No other case will return this code, and it lets userspace
know to fall back to write().

grep says we do not use it today in drivers/infiniband subsystem.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/uverbs_ioctl.c