WSL2-Linux-Kernel/drivers/md
Mike Snitzer 795e633a2d dm cache: fix device destroy hang due to improper prealloc_used accounting
Commit 665022d72f ("dm cache: avoid calls to prealloc_free_structs() if
possible") introduced a regression that caused the removal of a DM cache
device to hang in cache_postsuspend()'s call to wait_for_migrations()
with the following stack trace:

  [<ffffffff81651457>] schedule+0x37/0x80
  [<ffffffffa041e21b>] cache_postsuspend+0xbb/0x470 [dm_cache]
  [<ffffffff810ba970>] ? prepare_to_wait_event+0xf0/0xf0
  [<ffffffffa0006f77>] dm_table_postsuspend_targets+0x47/0x60 [dm_mod]
  [<ffffffffa0001eb5>] __dm_destroy+0x215/0x250 [dm_mod]
  [<ffffffffa0004113>] dm_destroy+0x13/0x20 [dm_mod]
  [<ffffffffa00098cd>] dev_remove+0x10d/0x170 [dm_mod]
  [<ffffffffa00097c0>] ? dev_suspend+0x240/0x240 [dm_mod]
  [<ffffffffa0009f85>] ctl_ioctl+0x255/0x4d0 [dm_mod]
  [<ffffffff8127ac00>] ? SYSC_semtimedop+0x280/0xe10
  [<ffffffffa000a213>] dm_ctl_ioctl+0x13/0x20 [dm_mod]
  [<ffffffff811fd432>] do_vfs_ioctl+0x2d2/0x4b0
  [<ffffffff81117d5f>] ? __audit_syscall_entry+0xaf/0x100
  [<ffffffff81022636>] ? do_audit_syscall_entry+0x66/0x70
  [<ffffffff811fd689>] SyS_ioctl+0x79/0x90
  [<ffffffff81023e58>] ? syscall_trace_leave+0xb8/0x110
  [<ffffffff81654f6e>] entry_SYSCALL_64_fastpath+0x12/0x71

Fix this by accounting for the call to prealloc_data_structs()
immediately _before_ the call as opposed to after.  This is needed
because it is possible to break out of the control loop after the call
to prealloc_data_structs() but before prealloc_used was set to true.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2015-07-29 14:32:09 -04:00
..
bcache
persistent-data
Kconfig dm crypt: update wiki page URL 2015-07-27 07:58:16 -04:00
Makefile
bitmap.c Some md fixes for 4.2 2015-07-25 11:24:58 -07:00
bitmap.h
dm-bio-prison.c
dm-bio-prison.h
dm-bio-record.h
dm-bufio.c
dm-bufio.h
dm-builtin.c
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-smq.c dm cache policy smq: fix alloc_bitset check that always evaluates as false 2015-07-27 07:58:15 -04:00
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: fix device destroy hang due to improper prealloc_used accounting 2015-07-29 14:32:09 -04:00
dm-crypt.c
dm-delay.c
dm-era-target.c
dm-exception-store.c
dm-exception-store.h
dm-flakey.c
dm-io.c
dm-ioctl.c
dm-kcopyd.c
dm-linear.c
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c
dm-log.c
dm-mpath.c
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid.c
dm-raid1.c
dm-region-hash.c
dm-round-robin.c
dm-service-time.c
dm-snap-persistent.c
dm-snap-transient.c
dm-snap.c
dm-stats.c
dm-stats.h
dm-stripe.c
dm-switch.c
dm-sysfs.c
dm-table.c
dm-target.c
dm-thin-metadata.c
dm-thin-metadata.h
dm-thin.c dm thin: return -ENOSPC when erroring retry list due to out of data space 2015-07-26 17:39:19 -04:00
dm-uevent.c
dm-uevent.h
dm-verity.c
dm-zero.c
dm.c
dm.h
faulty.c
linear.c
linear.h
md-cluster.c Fix read-balancing during node failure 2015-07-24 13:37:59 +10:00
md-cluster.h Fix read-balancing during node failure 2015-07-24 13:37:59 +10:00
md.c Some md fixes for 4.2 2015-07-25 11:24:58 -07:00
md.h
multipath.c
multipath.h
raid0.c
raid0.h
raid1.c Fix read-balancing during node failure 2015-07-24 13:37:59 +10:00
raid1.h
raid5.c md/raid5: clear R5_NeedReplace when no longer needed. 2015-07-24 13:38:04 +10:00
raid5.h
raid10.c md/raid10: always set reshape_safe when initializing reshape_position. 2015-07-22 14:08:24 +10:00
raid10.h