From 7999b01ec9e76ec8fb4a70f6149a39959e4708ce Mon Sep 17 00:00:00 2001 From: Thomas Bogendoerfer <tbogendoerfer@suse.de> Date: Jun 12 2020 09:26:31 +0000 Subject: RDMA/uverbs: Make the event_queue fds return POLLERR when disassociated (jsc#SLE-8449). --- diff --git a/patches.suse/RDMA-uverbs-Make-the-event_queue-fds-return-POLLERR-.patch b/patches.suse/RDMA-uverbs-Make-the-event_queue-fds-return-POLLERR-.patch new file mode 100644 index 0000000..c7124af --- /dev/null +++ b/patches.suse/RDMA-uverbs-Make-the-event_queue-fds-return-POLLERR-.patch @@ -0,0 +1,34 @@ +From: Jason Gunthorpe <jgg@mellanox.com> +Date: Mon, 6 Apr 2020 21:44:26 -0300 +Subject: RDMA/uverbs: Make the event_queue fds return POLLERR when + disassociated +Patch-mainline: v5.8-rc1 +Git-commit: eb356e6dc15a30af604f052cd0e170450193c254 +References: jsc#SLE-8449 + +If is_closed is set, and the event list is empty, then read() will return +-EIO without blocking. After setting is_closed in +ib_uverbs_free_event_queue(), we do trigger a wake_up on the poll_wait, +but the fops->poll() function does not check it, so poll will continue to +sleep on an empty list. + +Fixes: 14e23bd6d221 ("RDMA/core: Fix locking in ib_uverbs_event_read") +Link: https://lore.kernel.org/r/0-v1-ace813388969+48859-uverbs_poll_fix%25jgg@mellanox.com +Reviewed-by: Leon Romanovsky <leonro@mellanox.com> +Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> +Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> +--- + drivers/infiniband/core/uverbs_main.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/infiniband/core/uverbs_main.c ++++ b/drivers/infiniband/core/uverbs_main.c +@@ -296,6 +296,8 @@ static __poll_t ib_uverbs_event_poll(str + spin_lock_irq(&ev_queue->lock); + if (!list_empty(&ev_queue->event_list)) + pollflags = EPOLLIN | EPOLLRDNORM; ++ else if (ev_queue->is_closed) ++ pollflags = EPOLLERR; + spin_unlock_irq(&ev_queue->lock); + + return pollflags; diff --git a/series.conf b/series.conf index 3078148..62ad986 100644 --- a/series.conf +++ b/series.conf @@ -12456,6 +12456,7 @@ patches.suse/gpio-dwapb-Append-MODULE_ALIAS-for-platform-driver.patch patches.suse/gpiolib-Document-that-GPIO-line-names-are-not-global.patch patches.suse/gpio-dwapb-Call-acpi_gpiochip_free_interrupts-on-GPI.patch + patches.suse/RDMA-uverbs-Make-the-event_queue-fds-return-POLLERR-.patch patches.suse/scsi-lpfc-remove-duplicate-unloading-checks.patch patches.suse/scsi-lpfc-Maintain-atomic-consistency-of-queue_claim.patch patches.suse/scsi-lpfc-Remove-re-binding-of-nvme-rport-during-reg.patch