提交 a1842be8 编写于 作者: S Stefan Richter

ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_ne

nodemgr_resume_ne was iterating over nodemgr_ud_class.children without
protection by nodemgr_ud_class.subsys.rwsem.

FIXME:
Shouldn't we rather use class->sem there, not class->subsys.rwsem?
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
上级 9b516010
...@@ -1352,6 +1352,7 @@ static void nodemgr_resume_ne(struct node_entry *ne) ...@@ -1352,6 +1352,7 @@ static void nodemgr_resume_ne(struct node_entry *ne)
ne->in_limbo = 0; ne->in_limbo = 0;
device_remove_file(&ne->device, &dev_attr_ne_in_limbo); device_remove_file(&ne->device, &dev_attr_ne_in_limbo);
down_read(&nodemgr_ud_class.subsys.rwsem);
down_read(&ne->device.bus->subsys.rwsem); down_read(&ne->device.bus->subsys.rwsem);
list_for_each_entry(cdev, &nodemgr_ud_class.children, node) { list_for_each_entry(cdev, &nodemgr_ud_class.children, node) {
ud = container_of(cdev, struct unit_directory, class_dev); ud = container_of(cdev, struct unit_directory, class_dev);
...@@ -1363,6 +1364,7 @@ static void nodemgr_resume_ne(struct node_entry *ne) ...@@ -1363,6 +1364,7 @@ static void nodemgr_resume_ne(struct node_entry *ne)
ud->device.driver->resume(&ud->device); ud->device.driver->resume(&ud->device);
} }
up_read(&ne->device.bus->subsys.rwsem); up_read(&ne->device.bus->subsys.rwsem);
up_read(&nodemgr_ud_class.subsys.rwsem);
HPSB_DEBUG("Node resumed: ID:BUS[" NODE_BUS_FMT "] GUID[%016Lx]", HPSB_DEBUG("Node resumed: ID:BUS[" NODE_BUS_FMT "] GUID[%016Lx]",
NODE_BUS_ARGS(ne->host, ne->nodeid), (unsigned long long)ne->guid); NODE_BUS_ARGS(ne->host, ne->nodeid), (unsigned long long)ne->guid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册