linux/drivers/md
Mikulas Patocka 4f66403630 dm sysfs: fix a module unload race
commit 2995fa78e4 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>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-13 13:48:02 -08:00
..
bcache bcache: Data corruption fix 2014-02-06 11:08:16 -08:00
persistent-data dm space map metadata: fix bug in resizing of thin metadata 2014-02-13 13:48:01 -08:00
bitmap.c
bitmap.h
dm-bio-prison.c
dm-bio-prison.h
dm-bio-record.h
dm-bufio.c dm bufio: initialize read-only module parameters 2013-12-20 07:45:10 -08:00
dm-bufio.h
dm-builtin.c dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
dm-cache-block-types.h
dm-cache-metadata.c
dm-cache-metadata.h
dm-cache-policy-cleaner.c
dm-cache-policy-internal.h
dm-cache-policy-mq.c
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: fix a race condition between queuing new migrations and quiescing for a shutdown 2013-12-04 10:56:43 -08:00
dm-crypt.c
dm-delay.c dm delay: fix a possible deadlock due to shared workqueue 2013-12-20 07:45:11 -08:00
dm-exception-store.c
dm-exception-store.h
dm-flakey.c
dm-io.c
dm-ioctl.c dm ioctl: set noio flag to avoid __vmalloc deadlock 2013-08-04 16:51:02 +08:00
dm-kcopyd.c
dm-linear.c
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log.c
dm-mpath.c dm mpath: fix race condition between multipath_dtr and pg_init_done 2013-12-04 10:56:41 -08:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid.c dm-raid: silence compiler warning on rebuilds_per_group. 2013-10-05 07:13:11 -07:00
dm-raid1.c
dm-region-hash.c
dm-round-robin.c
dm-service-time.c
dm-snap-persistent.c dm snapshot: fix data corruption 2013-11-04 04:31:06 -08:00
dm-snap-transient.c
dm-snap.c dm snapshot: avoid snapshot space leak on crash 2013-12-20 07:45:10 -08:00
dm-stripe.c
dm-sysfs.c dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
dm-table.c dm table: fail dm_table_create on dm_round_up overflow 2013-12-20 07:45:11 -08:00
dm-target.c
dm-thin-metadata.c dm thin: fix discard support to a previously shared block 2014-02-13 13:48:01 -08:00
dm-thin-metadata.h dm thin: fix discard support to a previously shared block 2014-02-13 13:48:01 -08:00
dm-thin.c dm thin: initialize dm_thin_new_mapping returned by get_next_mapping 2014-02-13 13:48:01 -08:00
dm-uevent.c
dm-uevent.h
dm-verity.c dm verity: fix inability to use a few specific devices sizes 2013-08-04 16:51:02 +08:00
dm-zero.c
dm.c dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
dm.h dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
faulty.c
Kconfig dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
linear.c
linear.h
Makefile dm sysfs: fix a module unload race 2014-02-13 13:48:02 -08:00
md.c md: fix problem when adding device to read-only array with bitmap. 2014-01-25 08:27:12 -08:00
md.h md: fix problem when adding device to read-only array with bitmap. 2014-01-25 08:27:12 -08:00
multipath.c
multipath.h
raid1.c md: Fix skipping recovery for read-only arrays. 2013-11-13 12:05:32 +09:00
raid1.h
raid5.c md/raid5: fix long-standing problem with bitmap handling on write failure. 2014-02-06 11:08:12 -08:00
raid5.h md/raid5: fix interaction of 'replace' and 'recovery'. 2013-08-04 16:50:54 +08:00
raid10.c md/raid10: fix two bugs in handling of known-bad-blocks. 2014-01-25 08:27:12 -08:00
raid10.h
raid0.c
raid0.h