aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2013-08-19 16:56:44 -0400
committerBen Myers <bpm@sgi.com>2013-08-22 15:05:27 -0400
commit46677e679fba8c2db7c94a7142ad9abb72192ebc (patch)
treed244f08ff93011174544252f07d61517cefba1ec /fs/xfs/xfs_mount.c
parent3e3c51cee9a07d67e3910cc514867b56ac60ec94 (diff)
xfs: Register hotcpu notifier after initialization
Currently the code initializizes mp->m_icsb_mutex and other things _after_ register_hotcpu_notifier(). As the notifier takes mp->m_icsb_mutex it can happen that it takes the lock before it's initialization. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 38bcbbc21e92..5dcc68019d1b 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1548,12 +1548,6 @@ xfs_icsb_init_counters(
1548 if (mp->m_sb_cnts == NULL) 1548 if (mp->m_sb_cnts == NULL)
1549 return -ENOMEM; 1549 return -ENOMEM;
1550 1550
1551#ifdef CONFIG_HOTPLUG_CPU
1552 mp->m_icsb_notifier.notifier_call = xfs_icsb_cpu_notify;
1553 mp->m_icsb_notifier.priority = 0;
1554 register_hotcpu_notifier(&mp->m_icsb_notifier);
1555#endif /* CONFIG_HOTPLUG_CPU */
1556
1557 for_each_online_cpu(i) { 1551 for_each_online_cpu(i) {
1558 cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i); 1552 cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i);
1559 memset(cntp, 0, sizeof(xfs_icsb_cnts_t)); 1553 memset(cntp, 0, sizeof(xfs_icsb_cnts_t));
@@ -1566,6 +1560,13 @@ xfs_icsb_init_counters(
1566 * initial balance kicks us off correctly 1560 * initial balance kicks us off correctly
1567 */ 1561 */
1568 mp->m_icsb_counters = -1; 1562 mp->m_icsb_counters = -1;
1563
1564#ifdef CONFIG_HOTPLUG_CPU
1565 mp->m_icsb_notifier.notifier_call = xfs_icsb_cpu_notify;
1566 mp->m_icsb_notifier.priority = 0;
1567 register_hotcpu_notifier(&mp->m_icsb_notifier);
1568#endif /* CONFIG_HOTPLUG_CPU */
1569
1569 return 0; 1570 return 0;
1570} 1571}
1571 1572