aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/Kconfig
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2014-01-13 19:37:54 -0500
committerBen Hutchings <ben@decadent.org.uk>2014-04-02 00:58:43 +0100
commit43057146932997ca54a2326cfd6abe9fe1ec5a9f (patch)
treebfa876f0e2a6e1c327e42952dd3a51daea3299bd /drivers/md/Kconfig
parentb7785833fe6d2c3027d3e385d72bd31775031d2b (diff)
downloadkernel_samsung_smdk4412-43057146932997ca54a2326cfd6abe9fe1ec5a9f.zip
kernel_samsung_smdk4412-43057146932997ca54a2326cfd6abe9fe1ec5a9f.tar.gz
kernel_samsung_smdk4412-43057146932997ca54a2326cfd6abe9fe1ec5a9f.tar.bz2
dm sysfs: fix a module unload race
commit 2995fa78e423d7193f3b57835f6c1c75006a0315 upstream. This reverts commit be35f48610 ("dm: wait until embedded kobject is released before destroying a device") and provides an improved fix. The kobject release code that calls the completion must be placed in a non-module file, otherwise there is a module unload race (if the process calling dm_kobject_release is preempted and the DM module unloaded after the completion is triggered, but before dm_kobject_release returns). To fix this race, this patch moves the completion code to dm-builtin.c which is always compiled directly into the kernel if BLK_DEV_DM is selected. The patch introduces a new dm_kobject_holder structure, its purpose is to keep the completion and kobject in one place, so that it can be accessed from non-module code without the need to export the layout of struct mapped_device to that code. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> [bwh: Backported to 3.2: - Adjust context - Remove paranoid check of container_of() result in dm_get_from_kobject(), which would now be incorrect - Include <linux/export.h> in dm-builtin.c, included indirectly upstream] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/md/Kconfig')
-rw-r--r--drivers/md/Kconfig4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
index faa4741..e10b6bb 100644
--- a/drivers/md/Kconfig
+++ b/drivers/md/Kconfig
@@ -185,8 +185,12 @@ config MD_FAULTY
In unsure, say N.
+config BLK_DEV_DM_BUILTIN
+ boolean
+
config BLK_DEV_DM
tristate "Device mapper support"
+ select BLK_DEV_DM_BUILTIN
---help---
Device-mapper is a low level volume manager. It works by allowing
people to specify mappings for ranges of logical sectors. Various