--- /dev/null
+From 6a75a6b8e85e92cc774d42a4e113c76c30b5a539 Mon Sep 17 00:00:00 2001
+From: Milton Miller <miltonm@bga.com>
+Date: Mon, 20 Oct 2008 15:37:03 +0000
+Subject: powerpc: Use cpu_thread_in_core in smp_init for of_spin_map
+
+From: Milton Miller <miltonm@bga.com>
+
+commit 6a75a6b8e85e92cc774d42a4e113c76c30b5a539 upstream.
+
+We used to assume that even numbered threads were the primary
+threads, ie those that would be listed and started as a cpu from
+open firmware. Replace a left over is even (% 2) check with a check
+for it being a primary thread and update the comments.
+
+Tested with a debug print on pseries, identical code found for cell.
+
+Signed-off-by: Milton Miller <miltonm@bga.com>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/platforms/cell/smp.c | 10 +++-------
+ arch/powerpc/platforms/pseries/smp.c | 13 ++++---------
+ 2 files changed, 7 insertions(+), 16 deletions(-)
+
+--- a/arch/powerpc/platforms/cell/smp.c
++++ b/arch/powerpc/platforms/cell/smp.c
+@@ -54,8 +54,8 @@
+ #endif
+
+ /*
+- * The primary thread of each non-boot processor is recorded here before
+- * smp init.
++ * The Primary thread of each non-boot processor was started from the OF client
++ * interface by prom_hold_cpus and is spinning on secondary_hold_spinloop.
+ */
+ static cpumask_t of_spin_map;
+
+@@ -208,11 +208,7 @@ void __init smp_init_cell(void)
+ /* Mark threads which are still spinning in hold loops. */
+ if (cpu_has_feature(CPU_FTR_SMT)) {
+ for_each_present_cpu(i) {
+- if (i % 2 == 0)
+- /*
+- * Even-numbered logical cpus correspond to
+- * primary threads.
+- */
++ if (cpu_thread_in_core(i) == 0)
+ cpu_set(i, of_spin_map);
+ }
+ } else {
+--- a/arch/powerpc/platforms/pseries/smp.c
++++ b/arch/powerpc/platforms/pseries/smp.c
+@@ -52,8 +52,8 @@
+
+
+ /*
+- * The primary thread of each non-boot processor is recorded here before
+- * smp init.
++ * The Primary thread of each non-boot processor was started from the OF client
++ * interface by prom_hold_cpus and is spinning on secondary_hold_spinloop.
+ */
+ static cpumask_t of_spin_map;
+
+@@ -191,8 +191,7 @@ static void __devinit smp_pSeries_kick_c
+ static int smp_pSeries_cpu_bootable(unsigned int nr)
+ {
+ /* Special case - we inhibit secondary thread startup
+- * during boot if the user requests it. Odd-numbered
+- * cpus are assumed to be secondary threads.
++ * during boot if the user requests it.
+ */
+ if (system_state < SYSTEM_RUNNING &&
+ cpu_has_feature(CPU_FTR_SMT) &&
+@@ -229,11 +228,7 @@ static void __init smp_init_pseries(void
+ /* Mark threads which are still spinning in hold loops. */
+ if (cpu_has_feature(CPU_FTR_SMT)) {
+ for_each_present_cpu(i) {
+- if (i % 2 == 0)
+- /*
+- * Even-numbered logical cpus correspond to
+- * primary threads.
+- */
++ if (cpu_thread_in_core(i) == 0)
+ cpu_set(i, of_spin_map);
+ }
+ } else {
--- /dev/null
+From 576a488a27f267af203f3ea69c700a1612335e9f Mon Sep 17 00:00:00 2001
+From: Dave Chinner <david@fromorbit.com>
+Date: Thu, 4 Dec 2008 09:09:34 +1100
+Subject: XFS: Fix hang after disallowed rename across directory quota domains
+
+From: Dave Chinner <david@fromorbit.com>
+
+commit 576a488a27f267af203f3ea69c700a1612335e9f upstream.
+
+When project quota is active and is being used for directory tree
+quota control, we disallow rename outside the current directory
+tree. This requires a check to be made after all the inodes
+involved in the rename are locked. We fail to unlock the inodes
+correctly if we disallow the rename when the target is outside the
+current directory tree. This results in a hang on the next access
+to the inodes involved in failed rename.
+
+Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
+Signed-off-by: Dave Chinner <david@fromorbit.com>
+Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>
+Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/xfs/xfs_rename.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/xfs/xfs_rename.c
++++ b/fs/xfs/xfs_rename.c
+@@ -212,7 +212,7 @@ xfs_rename(
+ if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
+ (target_dp->i_d.di_projid != src_ip->i_d.di_projid))) {
+ error = XFS_ERROR(EXDEV);
+- xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
++ xfs_rename_unlock4(inodes, XFS_ILOCK_EXCL);
+ xfs_trans_cancel(tp, cancel_flags);
+ goto std_return;
+ }