diff options
author | Clark Williams <williams@redhat.com> | 2018-07-03 13:34:30 -0500 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2018-08-07 16:20:08 +0200 |
commit | 068f5490235c565ec0c7f3bb2ee6e35990b4d077 (patch) | |
tree | 0f7a0d8e2a3cbaf75053012ef94ca20465bd4473 /fs | |
parent | d9ac576603f6e1b9fd00960a28822f3a467d51b2 (diff) | |
download | linux-rt-068f5490235c565ec0c7f3bb2ee6e35990b4d077.tar.gz |
fscache: initialize cookie hash table raw spinlocks
The fscache cookie mechanism uses a hash table of hlist_bl_head structures. The
PREEMPT_RT patcheset adds a raw spinlock to this structure and so on PREEMPT_RT
the structures get used uninitialized, causing warnings about bad magic numbers
when spinlock debugging is turned on.
Use the init function for fscache cookies.
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fscache/cookie.c | 8 | ||||
-rw-r--r-- | fs/fscache/main.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c index 83bfe04456b6..9b7e2c5ba05e 100644 --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c @@ -973,3 +973,11 @@ inconsistent: return -ESTALE; } EXPORT_SYMBOL(__fscache_check_consistency); + +void __init fscache_cookie_init(void) +{ + int i; + + for (i = 0; i < (1 << fscache_cookie_hash_shift) - 1; i++) + INIT_HLIST_BL_HEAD(&fscache_cookie_hash[i]); +} diff --git a/fs/fscache/main.c b/fs/fscache/main.c index 7dce110bf17d..9f0464ab2484 100644 --- a/fs/fscache/main.c +++ b/fs/fscache/main.c @@ -151,6 +151,7 @@ static int __init fscache_init(void) ret = -ENOMEM; goto error_cookie_jar; } + fscache_cookie_init(); fscache_root = kobject_create_and_add("fscache", kernel_kobj); if (!fscache_root) |