mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock
Subsystems (3)
PATCH 1/1 mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock
When adding the memory by probing memory block in sysfs interface, there is an obvious issue that we will unlock the device_hotplug_lock when fails to takes it.
That issue was introduced in Commit 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock")
We should drop out in time when fails to take the device_hotplug_lock.
--- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/memory.c +1 -1
@@ -507,7 +507,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, ret =lock_device_hotplug_sysfs ();if (ret) - goto out; +return ret; nid =memory_add_physaddr_to_nid (phys_addr); ret = __add_memory(nid, phys_addr,
Signature · 1 line
1.7.12.4
Quoted 11 lines · zhong jiang
When adding the memory by probing memory block in sysfs interface, there is an obvious issue that we will unlock the
device_hotplug_lockwhen fails to takes it.That issue was introduced in Commit
8df1d0e4a265("mm/memory_hotplug: makeadd_memory()take thedevice_hotplug_lock")We should drop out in time when fails to take the
device_hotplug_lock.Fixes 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock")Reported-by Yang yingliang <[email protected]>Signed-off-by zhong jiang <[email protected]>
Quoted 20 lines
--- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/memory.c +1
-1@@ -507,7 +507,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, ret =lock_device_hotplug_sysfs ();if (ret) - goto out; +return ret; nid =memory_add_physaddr_to_nid (phys_addr); ret = __add_memory(nid, phys_addr,Signature · 1 line
1.7.12.4
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 21 lines · zhong jiang
When adding the memory by probing memory block in sysfs interface, there is an obvious issue that we will unlock the
device_hotplug_lockwhen fails to takes it.That issue was introduced in Commit
8df1d0e4a265("mm/memory_hotplug: makeadd_memory()take thedevice_hotplug_lock")We should drop out in time when fails to take the
device_hotplug_lock.Fixes 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock")Reported-by Yang yingliang <[email protected]>Signed-off-by zhong jiang <[email protected]>--- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/memory.c +0
-0
drivers/base/memory.c static ssize_t probe_store(struct device *dev, struct device_attribute *attr, · line 513
Quoted 8 lines
drivers/base/memory.c +1
-1@@ -507,7 +507,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, ret =lock_device_hotplug_sysfs ();if (ret) - goto out; +return ret; nid =memory_add_physaddr_to_nid (phys_addr); ret = __add_memory(nid, phys_addr,
Indeed
Signature · 3 lines
Thanks, David / dhildenb
Quoted 11 lines · zhong jiang
When adding the memory by probing memory block in sysfs interface, there is an obvious issue that we will unlock the
device_hotplug_lockwhen fails to takes it.That issue was introduced in Commit
8df1d0e4a265("mm/memory_hotplug: makeadd_memory()take thedevice_hotplug_lock")We should drop out in time when fails to take the
device_hotplug_lock.Fixes 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock")Reported-by Yang yingliang <[email protected]>Signed-off-by zhong jiang <[email protected]>
Signature · 2 lines
Oscar Salvador SUSE L3