projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a few 'const's.
[openvswitch]
/
datapath
/
dp_sysfs_if.c
diff --git
a/datapath/dp_sysfs_if.c
b/datapath/dp_sysfs_if.c
index d35821b693d791e78c475692ab620c11764c484c..f564e9808f26650beeb068392e49137f7454a7f1 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 Networks.
*
* 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
@@
-191,12
+191,12
@@
static ssize_t brport_store(struct kobject *kobj,
return -EPERM;
pr_warning("%s: xxx writing port parms not supported yet!\n",
return -EPERM;
pr_warning("%s: xxx writing port parms not supported yet!\n",
- dp_name(p->dp));
+
ovs_
dp_name(p->dp));
return ret;
}
return ret;
}
-struct sysfs_ops brport_sysfs_ops = {
+struct sysfs_ops
ovs_
brport_sysfs_ops = {
.show = brport_show,
.store = brport_store,
};
.show = brport_show,
.store = brport_store,
};
@@
-206,7
+206,7
@@
struct sysfs_ops brport_sysfs_ops = {
* Creates a brport subdirectory with bridge attributes.
* Puts symlink in bridge's brport subdirectory
*/
* Creates a brport subdirectory with bridge attributes.
* Puts symlink in bridge's brport subdirectory
*/
-int dp_sysfs_add_if(struct vport *p)
+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 datapath *dp = p->dp;
struct vport *local_port = rtnl_dereference(dp->ports[OVSP_LOCAL]);
@@
-217,6
+217,14
@@
int 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)
@@
-254,7
+262,7
@@
err:
return err;
}
return err;
}
-int dp_sysfs_del_if(struct vport *p)
+int
ovs_
dp_sysfs_del_if(struct vport *p)
{
if (p->linkname[0]) {
sysfs_remove_link(&p->dp->ifobj, p->linkname);
{
if (p->linkname[0]) {
sysfs_remove_link(&p->dp->ifobj, p->linkname);