Skip to contentSkip to conversation

FAILED: patch "[PATCH] IB/core: Fix error code for invalid GID entry" failed to apply to 4.4-stable tree

PATCH [email protected] 1 participant 1 message Jun 3, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From a840c93ca7582bb6c88df2345a33f979b7a67874 Mon Sep 17 00:00:00 2001

From: Parav Pandit <[email protected]>
Date: Sun, 27 May 2018 14:49:16 +0300
Subject: [PATCH] IB/core: Fix error code for invalid GID entry

When a GID entry is invalid EAGAIN is returned. This is an incorrect error code, there is nothing that will make this GID entry valid again in bounded time.

Some user space tools fail incorrectly if EAGAIN is returned here, and this represents a small ABI change from earlier kernels.

The first patch in the Fixes list makes entries that were valid before to become invalid, allowing this code to trigger, while the second patch in the Fixes list introduced the wrong EAGAIN.

Therefore revert the return result to EINVAL which matches the historical expectations of the ibv_query_gid_type() API of the libibverbs user space library.

Fixes 598ff6bae689 ("IB/core: Refactor GID modify code for RoCE")
Fixes 03db3a2d81e6 ("IB/core: Add RoCE GID table management")
drivers/infiniband/core/cache.c +1 -1
index fb2d347f760f..ecc55e98ddd3 100644
@@ -502,7 +502,7 @@ static int __ib_cache_gid_get(struct ib_device *ib_dev, u8 port, int index,
 		return -EINVAL;
 
 	if (table->data_vec[index].props & GID_TABLE_ENTRY_INVALID)
-		return -EAGAIN;
+		return -EINVAL;
 
 	memcpy(gid, &table->data_vec[index].gid, sizeof(*gid));
 	if (attr) {