diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2014-01-13 19:37:54 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-01-14 23:23:04 -0500 |
commit | 2995fa78e423d7193f3b57835f6c1c75006a0315 (patch) | |
tree | 9f107c0503a3c0ba58559a62847e9236f3fd1951 /drivers/md/Kconfig | |
parent | 55b082e614e219fb5199a6f93e648ed35d3c96d5 (diff) | |
download | linux-2995fa78e423d7193f3b57835f6c1c75006a0315.tar.gz linux-2995fa78e423d7193f3b57835f6c1c75006a0315.tar.bz2 linux-2995fa78e423d7193f3b57835f6c1c75006a0315.zip |
dm sysfs: fix a module unload race
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>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/md/Kconfig')
-rw-r--r-- | drivers/md/Kconfig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig index 39b540a13369..9a06fe883766 100644 --- a/drivers/md/Kconfig +++ b/drivers/md/Kconfig @@ -176,8 +176,12 @@ config MD_FAULTY source "drivers/md/bcache/Kconfig" +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 |