projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofp-util: Add ofputil_switch_features_ports_trunc function.
[openvswitch]
/
datapath
/
dp_sysfs_if.c
diff --git
a/datapath/dp_sysfs_if.c
b/datapath/dp_sysfs_if.c
index 5b695cfc003a582a3a86359beebbecb45ca3a481..219a260683902c16265e255b8b5eab41380a8cd2 100644
(file)
--- a/
datapath/dp_sysfs_if.c
+++ b/
datapath/dp_sysfs_if.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2007-201
1 Nicira Networks
.
+ * Copyright (c) 2007-201
2 Nicira, Inc
.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@
-209,7
+209,7
@@
struct sysfs_ops ovs_brport_sysfs_ops = {
int ovs_dp_sysfs_add_if(struct vport *p)
{
struct datapath *dp = p->dp;
int ovs_dp_sysfs_add_if(struct vport *p)
{
struct datapath *dp = p->dp;
- struct vport *local_port =
rtnl_dereference(dp->ports[OVSP_LOCAL]
);
+ struct vport *local_port =
ovs_vport_rtnl(dp, OVSP_LOCAL
);
struct brport_attribute **a;
int err;
struct brport_attribute **a;
int err;
@@
-217,6
+217,14
@@
int ovs_dp_sysfs_add_if(struct vport *p)
if (!p->ops->get_kobj)
return -ENOENT;
if (!p->ops->get_kobj)
return -ENOENT;
+#ifdef CONFIG_NET_NS
+ /* Due to bug in 2.6.32 kernel, sysfs_create_group() could panic
+ * in other namespace than init_net. Following check is to avoid it. */
+
+ if (!p->kobj.sd)
+ return -ENOENT;
+#endif
+
err = kobject_add(&p->kobj, p->ops->get_kobj(p),
SYSFS_BRIDGE_PORT_ATTR);
if (err)
err = kobject_add(&p->kobj, p->ops->get_kobj(p),
SYSFS_BRIDGE_PORT_ATTR);
if (err)