From: Greg Kroah-Hartman Date: Tue, 4 Feb 2014 19:53:10 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.4.79~1^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=414c2a7a8760620c8cffebfe4078096a52edd1b9;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: powerpc-make-sure-cache-directory-is-removed-when-offlining-cpu.patch --- diff --git a/queue-3.4/powerpc-make-sure-cache-directory-is-removed-when-offlining-cpu.patch b/queue-3.4/powerpc-make-sure-cache-directory-is-removed-when-offlining-cpu.patch new file mode 100644 index 00000000000..71bca7b5dff --- /dev/null +++ b/queue-3.4/powerpc-make-sure-cache-directory-is-removed-when-offlining-cpu.patch @@ -0,0 +1,50 @@ +From 91b973f90c1220d71923e7efe1e61f5329806380 Mon Sep 17 00:00:00 2001 +From: Paul Mackerras +Date: Sat, 18 Jan 2014 21:14:47 +1100 +Subject: powerpc: Make sure "cache" directory is removed when offlining cpu + +From: Paul Mackerras + +commit 91b973f90c1220d71923e7efe1e61f5329806380 upstream. + +The code in remove_cache_dir() is supposed to remove the "cache" +subdirectory from the sysfs directory for a CPU when that CPU is +being offlined. It tries to do this by calling kobject_put() on +the kobject for the subdirectory. However, the subdirectory only +gets removed once the last reference goes away, and the reference +being put here may well not be the last reference. That means +that the "cache" subdirectory may still exist when the offlining +operation has finished. If the same CPU subsequently gets onlined, +the code tries to add a new "cache" subdirectory. If the old +subdirectory has not yet been removed, we get a WARN_ON in the +sysfs code, with stack trace, and an error message printed on the +console. Further, we ultimately end up with an online cpu with no +"cache" subdirectory. + +This fixes it by doing an explicit kobject_del() at the point where +we want the subdirectory to go away. kobject_del() removes the sysfs +directory even though the object still exists in memory. The object +will get freed at some point in the future. A subsequent onlining +operation can create a new sysfs directory, even if the old object +still exists in memory, without causing any problems. + +Signed-off-by: Paul Mackerras +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/cacheinfo.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/powerpc/kernel/cacheinfo.c ++++ b/arch/powerpc/kernel/cacheinfo.c +@@ -788,6 +788,9 @@ static void remove_cache_dir(struct cach + { + remove_index_dirs(cache_dir); + ++ /* Remove cache dir from sysfs */ ++ kobject_del(cache_dir->kobj); ++ + kobject_put(cache_dir->kobj); + + kfree(cache_dir); diff --git a/queue-3.4/series b/queue-3.4/series index e05ece6d16e..0013d5fcbf2 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -34,3 +34,4 @@ usb-core-get-config-and-string-descriptors-for-unauthorized-devices.patch scsi-bfa-chinook-quad-port-16g-fc-hba-claim-issue.patch target-iscsi-fix-network-portal-creation-race.patch btrfs-handle-eagain-case-properly-in-btrfs_drop_snapshot.patch +powerpc-make-sure-cache-directory-is-removed-when-offlining-cpu.patch