Skip to contentSkip to conversation

Patch "IB/IPoIB: ibX: failed to create mcg debug file" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message May 17, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

IB/IPoIB: ibX: failed to create mcg debug file

to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ib-ipoib-ibx-failed-to-create-mcg-debug-file.patch
and it can be found in the queue-4.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 771a52584096c45e4565e8aabb596eece9d73d61 Mon Sep 17 00:00:00 2001

From: Shamir Rabinovitch <[email protected]>
Date: Wed, 29 Mar 2017 06:21:59 -0400
Subject: IB/IPoIB: ibX: failed to create mcg debug file

From: Shamir Rabinovitch <[email protected]>

commit 771a52584096c45e4565e8aabb596eece9d73d61 upstream.

When udev renames the netdev devices, ipoib debugfs entries does not get renamed. As a result, if subsequent probe of ipoib device reuse the name then creating a debugfs entry for the new device would fail.

Also, moved ipoib_create_debug_files and ipoib_delete_debug_files as part of ipoib event handling in order to avoid any race condition between these.

Fixes 1732b0ef3b3a ([IPoIB] add path record information in debugfs)
---
 drivers/infiniband/ulp/ipoib/ipoib_fs.c   |    3 ++
 drivers/infiniband/ulp/ipoib/ipoib_main.c |   44 ++++++++++++++++++++++++++----
 drivers/infiniband/ulp/ipoib/ipoib_vlan.c |    3 --
 3 files changed, 42 insertions(+), 8 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_fs.c +3 -0
@@ -281,8 +281,11 @@ void ipoib_delete_debug_files(struct net
 {
 	struct ipoib_dev_priv *priv = netdev_priv(dev);
 
+	WARN_ONCE(!priv->mcg_dentry, "null mcg debug file\n");
+	WARN_ONCE(!priv->path_dentry, "null path debug file\n");
 	debugfs_remove(priv->mcg_dentry);
 	debugfs_remove(priv->path_dentry);
+	priv->mcg_dentry = priv->path_dentry = NULL;
 }
 
 int ipoib_register_debugfs(void)
drivers/infiniband/ulp/ipoib/ipoib_main.c +39 -5

86 lines not on this page · raw message

drivers/infiniband/ulp/ipoib/ipoib_vlan.c +0 -3
@@ -87,8 +87,6 @@ int __ipoib_vlan_add(struct ipoib_dev_pr
 		goto register_failed;
 	}
 
-	ipoib_create_debug_files(priv->dev);
-
 	/* RTNL childs don't need proprietary sysfs entries */
 	if (type == IPOIB_LEGACY_CHILD) {
 		if (ipoib_cm_add_mode_attr(priv->dev))
@@ -109,7 +107,6 @@ int __ipoib_vlan_add(struct ipoib_dev_pr
 
 sysfs_failed:
 	result = -ENOMEM;
-	ipoib_delete_debug_files(priv->dev);
 	unregister_netdevice(priv->dev);
 
 register_failed:

Patches currently in stable-queue which might be from [email protected] are

queue-4.10/ib-ipoib-ibx-failed-to-create-mcg-debug-file.patch