IB/umad: Return EPOLLERR in case of when device disassociated
authorShay Drory <shayd@nvidia.com>
Mon, 25 Jan 2021 12:13:39 +0000 (14:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:01 +0000 (11:38 +0100)
commit69ca7a12b77db865e19ff7c73a67f4ba94f055f3
treecee7777153b5d79c849121c2430bf8bbfcfa3993
parent1598e9e00a99accc73badd619fe03cde72961463
IB/umad: Return EPOLLERR in case of when device disassociated

[ Upstream commit def4cd43f522253645b72c97181399c241b54536 ]

Currently, polling a umad device will always works, even if the device was
disassociated. A disassociated device should immediately return EPOLLERR
from poll(). Otherwise userspace is endlessly hung on poll() with no idea
that the device has been removed from the system.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://lore.kernel.org/r/20210125121339.837518-3-leon@kernel.org
Signed-off-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/user_mad.c