Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

six locks: Disable percpu read lock mode in userspace

When running in userspace, we currently don't have a real percpu
implementation available - at least in bcachefs-tools, which is where
this code is currently used in userspace.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

+6
+6
fs/bcachefs/six.c
··· 870 870 lockdep_init_map(&lock->dep_map, name, key, 0); 871 871 #endif 872 872 873 + /* 874 + * Don't assume that we have real percpu variables available in 875 + * userspace: 876 + */ 877 + #ifdef __KERNEL__ 873 878 if (flags & SIX_LOCK_INIT_PCPU) { 874 879 /* 875 880 * We don't return an error here on memory allocation failure ··· 885 880 */ 886 881 lock->readers = alloc_percpu(unsigned); 887 882 } 883 + #endif 888 884 } 889 885 EXPORT_SYMBOL_GPL(__six_lock_init);