linux_dsm_epyc7002/drivers/md
Mikulas Patocka 32a926da5a dm: always hold bdev reference
Fix a potential deadlock when creating multiple snapshots by holding a
reference to struct block_device for the whole lifecycle of every dm
device instead of obtaining it independently at each point it is needed.

bdget_disk() was called while the device was being suspended, in
dm_suspend().  However there could be other devices already suspended,
for example when creating additional snapshots of a device. bdget_disk()
can wait for IO and allocate memory resulting in waiting for the
already-suspended device - deadlock.

This patch changes the code so that it gets the reference to struct
block_device when struct mapped_device is allocated and initialized in
alloc_dev() where it is always OK to allocate memory or wait for I/O.
It drops the reference when it is destroyed in free_dev().  Thus there
is no call to bdget_disk() while any device is suspended.

Previously unlock_fs() was called only if bdev was held.  Now it is
called unconditionally, but the superfluous calls are harmless because
it returns immediately if the filesystem was not previously frozen.

This patch also now allows the device size to be changed in a
noflush suspend because the bdev is held.  This has no adverse effect.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2009-06-22 10:12:17 +01:00
..
raid6test
.gitignore
bitmap.c
bitmap.h
dm-bio-record.h
dm-crypt.c
dm-delay.c
dm-exception-store.c dm exception store: fix exstore lookup to be case insensitive 2009-06-22 10:12:15 +01:00
dm-exception-store.h dm: use i_size_read 2009-06-22 10:12:14 +01:00
dm-io.c
dm-ioctl.c
dm-kcopyd.c
dm-linear.c
dm-log.c dm: use i_size_read 2009-06-22 10:12:14 +01:00
dm-mpath.c dm mpath: flush keventd queue in destructor 2009-06-22 10:12:13 +01:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-raid1.c
dm-region-hash.c dm raid1: keep retrying alloc if mempool_alloc failed 2009-06-22 10:12:13 +01:00
dm-round-robin.c
dm-snap-persistent.c
dm-snap-transient.c
dm-snap.c
dm-stripe.c
dm-sysfs.c
dm-table.c dm: use i_size_read 2009-06-22 10:12:14 +01:00
dm-target.c
dm-uevent.c
dm-uevent.h
dm-zero.c
dm.c dm: always hold bdev reference 2009-06-22 10:12:17 +01:00
dm.h
faulty.c md: Move check for bitmap presence to personality code. 2009-06-18 08:49:23 +10:00
Kconfig
linear.c md/linear: use call_rcu to free obsolete 'conf' structures. 2009-06-18 08:49:42 +10:00
linear.h md/linear: use call_rcu to free obsolete 'conf' structures. 2009-06-18 08:49:42 +10:00
Makefile
md.c md: Move check for bitmap presence to personality code. 2009-06-18 08:49:23 +10:00
md.h md: Move check for bitmap presence to personality code. 2009-06-18 08:49:23 +10:00
mktables.c
multipath.c md: Move check for bitmap presence to personality code. 2009-06-18 08:49:23 +10:00
multipath.h
raid0.c md: Move check for bitmap presence to personality code. 2009-06-18 08:49:23 +10:00
raid0.h
raid1.c md: Push down reconstruction log message to personality code. 2009-06-18 08:48:06 +10:00
raid1.h
raid5.c md/raid5: correctly update sync_completed when we reach max_resync 2009-06-18 09:14:12 +10:00
raid5.h md: convert conf->chunk_size and conf->prev_chunk to sectors. 2009-06-18 08:45:55 +10:00
raid6algos.c
raid6altivec.uc
raid6int.uc
raid6mmx.c
raid6recov.c
raid6sse1.c
raid6sse2.c
raid6x86.h
raid10.c md: Push down reconstruction log message to personality code. 2009-06-18 08:48:06 +10:00
raid10.h
unroll.pl