diff options
author | Richard Weinberger <richard@nod.at> | 2013-08-19 22:56:44 +0200 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-22 14:05:27 -0500 |
commit | 46677e679fba8c2db7c94a7142ad9abb72192ebc (patch) | |
tree | d244f08ff93011174544252f07d61517cefba1ec /fs | |
parent | 3e3c51cee9a07d67e3910cc514867b56ac60ec94 (diff) | |
download | op-kernel-dev-46677e679fba8c2db7c94a7142ad9abb72192ebc.zip op-kernel-dev-46677e679fba8c2db7c94a7142ad9abb72192ebc.tar.gz |
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')
-rw-r--r-- | fs/xfs/xfs_mount.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 38bcbbc..5dcc680 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1548,12 +1548,6 @@ xfs_icsb_init_counters( if (mp->m_sb_cnts == NULL) return -ENOMEM; -#ifdef CONFIG_HOTPLUG_CPU - mp->m_icsb_notifier.notifier_call = xfs_icsb_cpu_notify; - mp->m_icsb_notifier.priority = 0; - register_hotcpu_notifier(&mp->m_icsb_notifier); -#endif /* CONFIG_HOTPLUG_CPU */ - for_each_online_cpu(i) { cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i); memset(cntp, 0, sizeof(xfs_icsb_cnts_t)); @@ -1566,6 +1560,13 @@ xfs_icsb_init_counters( * initial balance kicks us off correctly */ mp->m_icsb_counters = -1; + +#ifdef CONFIG_HOTPLUG_CPU + mp->m_icsb_notifier.notifier_call = xfs_icsb_cpu_notify; + mp->m_icsb_notifier.priority = 0; + register_hotcpu_notifier(&mp->m_icsb_notifier); +#endif /* CONFIG_HOTPLUG_CPU */ + return 0; } |