android_kernel_oneplus_msm8998/drivers/md
Mike Snitzer dce708809d dm cache: fix resize crash if user doesn't reload cache table
commit 5d07384a666d4b2f781dc056bfeec2c27fbdf383 upstream.

A reload of the cache's DM table is needed during resize because
otherwise a crash will occur when attempting to access smq policy
entries associated with the portion of the cache that was recently
extended.

The reason is cache-size based data structures in the policy will not be
resized, the only way to safely extend the cache is to allow for a
proper cache policy initialization that occurs when the cache table is
loaded.  For example the smq policy's space_init(), init_allocator(),
calc_hotspot_params() must be sized based on the extended cache size.

The fix for this is to disallow cache resizes of this pattern:
1) suspend "cache" target's device
2) resize the fast device used for the cache
3) resume "cache" target's device

Instead, the last step must be a full reload of the cache's DM table.

Fixes: 66a636356 ("dm cache: add stochastic-multi-queue (smq) policy")
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-13 09:11:32 +02:00
..
bcache bcache: release dc->writeback_lock properly in bch_writeback_thread() 2018-09-09 20:04:36 +02:00
persistent-data dm btree: fix serious bug in btree_split_beneath() 2018-01-23 19:50:16 +01:00
bitmap.c md/bitmap: disable bitmap_resize for file-backed bitmaps. 2017-09-27 11:00:14 +02:00
bitmap.h
dm-bio-prison.c
dm-bio-prison.h
dm-bio-record.h
dm-bufio.c dm bufio: don't take the lock in dm_bufio_shrink_count 2018-07-11 16:03:51 +02:00
dm-bufio.h
dm-builtin.c
dm-cache-block-types.h
dm-cache-metadata.c dm cache metadata: save in-core policy_hint_size to on-disk superblock 2018-09-09 20:04:33 +02:00
dm-cache-metadata.h dm cache: make sure every metadata function checks fail_io 2016-04-12 09:08:40 -07:00
dm-cache-policy-cleaner.c - Revert a dm-multipath change that caused a regression for unprivledged 2015-11-04 21:19:53 -08:00
dm-cache-policy-internal.h
dm-cache-policy-mq.c
dm-cache-policy-smq.c
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: fix resize crash if user doesn't reload cache table 2018-10-13 09:11:32 +02:00
dm-crypt.c dm crypt: mark key as invalid until properly loaded 2017-01-06 11:16:15 +01:00
dm-delay.c
dm-era-target.c dm era: save spacemap metadata root after the pre-commit 2017-05-20 14:27:00 +02:00
dm-exception-store.c - Revert a dm-multipath change that caused a regression for unprivledged 2015-11-04 21:19:53 -08:00
dm-exception-store.h dm snapshot: fix hung bios when copy error occurs 2016-03-03 15:07:14 -08:00
dm-flakey.c dm flakey: return -EINVAL on interval bounds error in flakey_ctr() 2017-01-06 11:16:15 +01:00
dm-io.c dm io: fix duplicate bio completion due to missing ref count 2018-03-11 16:19:47 +01:00
dm-ioctl.c dm ioctl: remove double parentheses 2018-04-08 11:51:57 +02:00
dm-kcopyd.c dm kcopyd: avoid softlockup in run_complete_job 2018-09-15 09:40:39 +02:00
dm-linear.c
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c dm log writes: fix bug with too large bios 2016-10-07 15:23:47 +02:00
dm-log.c
dm-mpath.c dm mpath: check if path's request_queue is dying in activate_path() 2016-10-28 03:01:28 -04:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid.c
dm-raid1.c dm mirror: fix read error on recovery after default leg failure 2016-11-10 16:36:35 +01:00
dm-region-hash.c
dm-round-robin.c
dm-service-time.c
dm-snap-persistent.c dm snapshot: fix hung bios when copy error occurs 2016-03-03 15:07:14 -08:00
dm-snap-transient.c dm snapshot: fix hung bios when copy error occurs 2016-03-03 15:07:14 -08:00
dm-snap.c dm snapshot: disallow the COW and origin devices from being identical 2016-04-12 09:08:39 -07:00
dm-stats.c dm stats: fix a leaked s->histogram_boundaries array 2017-03-12 06:37:26 +01:00
dm-stats.h
dm-stripe.c
dm-switch.c
dm-sysfs.c
dm-table.c dm snapshot: disallow the COW and origin devices from being identical 2016-04-12 09:08:39 -07:00
dm-target.c
dm-thin-metadata.c dm thin metadata: fix __udivdi3 undefined on 32-bit 2018-10-10 08:52:13 +02:00
dm-thin-metadata.h
dm-thin.c dm thin metadata: try to avoid ever aborting transactions 2018-10-10 08:52:12 +02:00
dm-uevent.c
dm-uevent.h
dm-verity.c
dm-zero.c
dm.c dm: correctly handle chained bios in dec_pending() 2018-02-22 15:45:01 +01:00
dm.h
faulty.c
Kconfig dm raid: select the Kconfig option CONFIG_MD_RAID0 2017-05-25 14:30:07 +02:00
linear.c md/linear: shutup lockdep warnning 2017-10-21 17:09:05 +02:00
linear.h md linear: fix a race between linear_add() and linear_congested() 2017-03-12 06:37:30 +01:00
Makefile
md-cluster.c md-cluster: clear another node's suspend_area after the copy is finished 2018-10-10 08:52:04 +02:00
md-cluster.h
md.c md: fix NULL dereference of mddev->pers in remove_and_add_spares() 2018-08-06 16:24:35 +02:00
md.h md/raid: only permit hot-add of compatible integrity profiles 2016-02-17 12:30:57 -08:00
multipath.c md: multipath: don't hardcopy bio in .make_request path 2016-04-12 09:08:57 -07:00
multipath.h
raid0.c
raid0.h
raid1.c md/raid1: fix NULL pointer dereference 2018-05-30 07:49:01 +02:00
raid1.h
raid5-cache.c
raid5.c md/raid5: fix data corruption of replacements after originals dropped 2018-09-19 22:48:57 +02:00
raid5.h RAID5: revert e9e4c377e2 to fix a livelock 2016-04-12 09:08:57 -07:00
raid10.c RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0 2018-10-10 08:52:11 +02:00
raid10.h