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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull lockdep fix from Ingo Molnar:
"A lockdep/modules unload race fix that can oops"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
lockdep: Fix a race between /proc/lock_stat and module unload

+19 -6
+2 -1
kernel/locking/lockdep.c
··· 3900 3900 list_del_rcu(&class->hash_entry); 3901 3901 list_del_rcu(&class->lock_entry); 3902 3902 3903 - class->key = NULL; 3903 + RCU_INIT_POINTER(class->key, NULL); 3904 + RCU_INIT_POINTER(class->name, NULL); 3904 3905 } 3905 3906 3906 3907 static inline int within(const void *addr, void *start, unsigned long size)
+17 -5
kernel/locking/lockdep_proc.c
··· 426 426 427 427 static void seq_stats(struct seq_file *m, struct lock_stat_data *data) 428 428 { 429 - char name[39]; 430 - struct lock_class *class; 429 + struct lockdep_subclass_key *ckey; 431 430 struct lock_class_stats *stats; 431 + struct lock_class *class; 432 + const char *cname; 432 433 int i, namelen; 434 + char name[39]; 433 435 434 436 class = data->class; 435 437 stats = &data->stats; ··· 442 440 if (class->subclass) 443 441 namelen -= 2; 444 442 445 - if (!class->name) { 443 + rcu_read_lock_sched(); 444 + cname = rcu_dereference_sched(class->name); 445 + ckey = rcu_dereference_sched(class->key); 446 + 447 + if (!cname && !ckey) { 448 + rcu_read_unlock_sched(); 449 + return; 450 + 451 + } else if (!cname) { 446 452 char str[KSYM_NAME_LEN]; 447 453 const char *key_name; 448 454 449 - key_name = __get_key_name(class->key, str); 455 + key_name = __get_key_name(ckey, str); 450 456 snprintf(name, namelen, "%s", key_name); 451 457 } else { 452 - snprintf(name, namelen, "%s", class->name); 458 + snprintf(name, namelen, "%s", cname); 453 459 } 460 + rcu_read_unlock_sched(); 461 + 454 462 namelen = strlen(name); 455 463 if (class->name_version > 1) { 456 464 snprintf(name+namelen, 3, "#%d", class->name_version);