Commit 0b0c7dbd986440474b4d6771611da59c22b63078

Authored by Linus Torvalds

Merge tag 'driver-core-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are 3 tiny fixes for 3.18-rc4.

  One fixes up a long-stading race condition in the driver core for
  removing directories in /sys/devices/virtual/ and the other 2 fix up
  the wording of a new Kconfig option that was added in 3.18-rc1"

* tag 'driver-core-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  tiny: rename ENABLE_DEV_COREDUMP to ALLOW_DEV_COREDUMP
  tiny: reverse logic for DISABLE_DEV_COREDUMP
  sysfs: driver core: Fix glue dir race condition by gdp_mutex

Showing 2 changed files Side-by-side Diff

drivers/base/Kconfig
... ... @@ -171,20 +171,23 @@
171 171 Drivers should "select" this option if they desire to use the
172 172 device coredump mechanism.
173 173  
174   -config DISABLE_DEV_COREDUMP
175   - bool "Disable device coredump" if EXPERT
  174 +config ALLOW_DEV_COREDUMP
  175 + bool "Allow device coredump" if EXPERT
  176 + default y
176 177 help
177   - Disable the device coredump mechanism despite drivers wanting to
178   - use it; this allows for more sensitive systems or systems that
179   - don't want to ever access the information to not have the code,
180   - nor keep any data.
  178 + This option controls if the device coredump mechanism is available or
  179 + not; if disabled, the mechanism will be omitted even if drivers that
  180 + can use it are enabled.
  181 + Say 'N' for more sensitive systems or systems that don't want
  182 + to ever access the information to not have the code, nor keep any
  183 + data.
181 184  
182   - If unsure, say N.
  185 + If unsure, say Y.
183 186  
184 187 config DEV_COREDUMP
185 188 bool
186 189 default y if WANT_DEV_COREDUMP
187   - depends on !DISABLE_DEV_COREDUMP
  190 + depends on ALLOW_DEV_COREDUMP
188 191  
189 192 config DEBUG_DRIVER
190 193 bool "Driver Core verbose debug messages"
... ... @@ -724,12 +724,12 @@
724 724 return &dir->kobj;
725 725 }
726 726  
  727 +static DEFINE_MUTEX(gdp_mutex);
727 728  
728 729 static struct kobject *get_device_parent(struct device *dev,
729 730 struct device *parent)
730 731 {
731 732 if (dev->class) {
732   - static DEFINE_MUTEX(gdp_mutex);
733 733 struct kobject *kobj = NULL;
734 734 struct kobject *parent_kobj;
735 735 struct kobject *k;
736 736  
... ... @@ -793,7 +793,9 @@
793 793 glue_dir->kset != &dev->class->p->glue_dirs)
794 794 return;
795 795  
  796 + mutex_lock(&gdp_mutex);
796 797 kobject_put(glue_dir);
  798 + mutex_unlock(&gdp_mutex);
797 799 }
798 800  
799 801 static void cleanup_device_parent(struct device *dev)