diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-10 22:13:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-10 22:15:00 -0400 |
commit | 17d1c4f4fe29453fbb4087eb5de8aa6f9e6605c7 (patch) | |
tree | 84a0fb52242d7890ff6b2eb8c449b696f2edd844 /linux/six.c | |
parent | 7a66cf70c5d8b02f84595e5648c12e7422e4d03e (diff) |
Update bcachefs sources to ed6b7f81a7 six locks: Disable percpu read lock mode in userspace
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'linux/six.c')
-rw-r--r-- | linux/six.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/six.c b/linux/six.c index d4f43f15..5b81c3fc 100644 --- a/linux/six.c +++ b/linux/six.c @@ -878,6 +878,11 @@ void __six_lock_init(struct six_lock *lock, const char *name, lockdep_init_map(&lock->dep_map, name, key, 0); #endif + /* + * Don't assume that we have real percpu variables available in + * userspace: + */ +#ifdef __KERNEL__ if (flags & SIX_LOCK_INIT_PCPU) { /* * We don't return an error here on memory allocation failure @@ -888,5 +893,6 @@ void __six_lock_init(struct six_lock *lock, const char *name, */ lock->readers = alloc_percpu(unsigned); } +#endif } EXPORT_SYMBOL_GPL(__six_lock_init); |