2020-01-19 00:54:59 +00:00
|
|
|
From 11a5fe1b2f98fc37eac8919e99282c1b91f5bb05 Mon Sep 17 00:00:00 2001
|
2018-08-27 14:32:32 +00:00
|
|
|
From: Clark Williams <williams@redhat.com>
|
|
|
|
Date: Tue, 3 Jul 2018 13:34:30 -0500
|
2020-01-19 00:54:59 +00:00
|
|
|
Subject: [PATCH 015/290] fscache: initialize cookie hash table raw spinlocks
|
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.94-rt38.tar.xz
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
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>
|
|
|
|
---
|
2019-04-08 23:49:20 +00:00
|
|
|
fs/fscache/cookie.c | 8 ++++++++
|
|
|
|
fs/fscache/main.c | 1 +
|
|
|
|
include/linux/fscache.h | 1 +
|
2018-08-27 14:32:32 +00:00
|
|
|
3 files changed, 10 insertions(+)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
|
|
|
|
index c550512ce335..d5d57da32ffa 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/fs/fscache/cookie.c
|
|
|
|
+++ b/fs/fscache/cookie.c
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -962,3 +962,11 @@ int __fscache_check_consistency(struct fscache_cookie *cookie,
|
2018-08-27 14:32:32 +00:00
|
|
|
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]);
|
|
|
|
+}
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
|
|
|
|
index 30ad89db1efc..1d5f1d679ffa 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/fs/fscache/main.c
|
|
|
|
+++ b/fs/fscache/main.c
|
2018-10-30 12:40:05 +00:00
|
|
|
@@ -149,6 +149,7 @@ static int __init fscache_init(void)
|
2018-08-27 14:32:32 +00:00
|
|
|
ret = -ENOMEM;
|
|
|
|
goto error_cookie_jar;
|
|
|
|
}
|
|
|
|
+ fscache_cookie_init();
|
|
|
|
|
|
|
|
fscache_root = kobject_create_and_add("fscache", kernel_kobj);
|
|
|
|
if (!fscache_root)
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
|
|
|
|
index 84b90a79d75a..87a9330eafa2 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/include/linux/fscache.h
|
|
|
|
+++ b/include/linux/fscache.h
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -230,6 +230,7 @@ extern void __fscache_readpages_cancel(struct fscache_cookie *cookie,
|
2018-08-27 14:32:32 +00:00
|
|
|
extern void __fscache_disable_cookie(struct fscache_cookie *, const void *, bool);
|
|
|
|
extern void __fscache_enable_cookie(struct fscache_cookie *, const void *, loff_t,
|
|
|
|
bool (*)(void *), void *);
|
|
|
|
+extern void fscache_cookie_init(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* fscache_register_netfs - Register a filesystem as desiring caching services
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-01-19 00:54:59 +00:00
|
|
|
2.24.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|