summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp/ipoib/ipoib_fs.c
diff options
context:
space:
mode:
authorShamir Rabinovitch <shamir.rabinovitch@oracle.com>2017-03-29 13:21:59 +0300
committerBen Hutchings <ben@decadent.org.uk>2017-08-26 04:14:28 +0300
commit8a9bdfc0b813471e04b74cf7a3999febaf50a7bc (patch)
treed4c6cde3c35bc2d18c0850787f163bef57041c2f /drivers/infiniband/ulp/ipoib/ipoib_fs.c
parent01168394ba812e29b1b6caf31bd3d97678573484 (diff)
downloadlinux-8a9bdfc0b813471e04b74cf7a3999febaf50a7bc.tar.xz
IB/IPoIB: ibX: failed to create mcg debug file
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) Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com> Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com> Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_fs.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_fs.c b/drivers/infiniband/ulp/ipoib/ipoib_fs.c
index 6bd5740e2691..09396bd7b02d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_fs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_fs.c
@@ -281,8 +281,11 @@ void ipoib_delete_debug_files(struct net_device *dev)
{
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)