linux_dsm_epyc7002/drivers/md
Damien Le Moal d57f9da890 dm zoned: Fix target BIO completion handling
struct bioctx includes the ref refcount_t to track the number of I/O
fragments used to process a target BIO as well as ensure that the zone
of the BIO is kept in the active state throughout the lifetime of the
BIO. However, since decrementing of this reference count is done in the
target .end_io method, the function bio_endio() must be called multiple
times for read and write target BIOs, which causes problems with the
value of the __bi_remaining struct bio field for chained BIOs (e.g. the
clone BIO passed by dm core is large and splits into fragments by the
block layer), resulting in incorrect values and inconsistencies with the
BIO_CHAIN flag setting. This is turn triggers the BUG_ON() call:

BUG_ON(atomic_read(&bio->__bi_remaining) <= 0);

in bio_remaining_done() called from bio_endio().

Fix this ensuring that bio_endio() is called only once for any target
BIO by always using internal clone BIOs for processing any read or
write target BIO. This allows reference counting using the target BIO
context counter to trigger the target BIO completion bio_endio() call
once all data, metadata and other zone work triggered by the BIO
complete.

Overall, this simplifies the code too as the target .end_io becomes
unnecessary and differences between read and write BIO issuing and
completion processing disappear.

Fixes: 3b1a94c88b ("dm zoned: drive-managed zoned block device target")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2018-12-07 16:04:31 -05:00
..
bcache bcache: panic fix for making cache device 2018-10-08 08:19:59 -06:00
persistent-data dm: Avoid namespace collision with bitmap API 2018-08-01 15:49:38 -07:00
dm-bio-prison-v1.c
dm-bio-prison-v1.h
dm-bio-prison-v2.c
dm-bio-prison-v2.h
dm-bio-record.h
dm-bufio.c
dm-builtin.c
dm-cache-background-tracker.c
dm-cache-background-tracker.h
dm-cache-block-types.h
dm-cache-metadata.c dm cache metadata: verify cache has blocks in blocks_are_clean_separate_dirty() 2018-12-07 16:04:09 -05:00
dm-cache-metadata.h
dm-cache-policy-internal.h
dm-cache-policy-smq.c dm: remove unnecessary unlikely() around WARN_ON_ONCE() 2018-10-16 14:34:59 -04:00
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: destroy migration_cache if cache target registration failed 2018-10-09 13:53:03 -04:00
dm-core.h dm: remove legacy request-based IO path 2018-10-11 11:36:09 -04:00
dm-crypt.c dm crypt: make workqueue names device-specific 2018-10-18 12:17:17 -04:00
dm-delay.c dm delay: add flush as a third class of IO 2018-07-27 15:24:19 -04:00
dm-era-target.c
dm-exception-store.c
dm-exception-store.h
dm-flakey.c block: add a report_zones method 2018-10-25 11:17:40 -06:00
dm-integrity.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-10-25 16:43:35 -07:00
dm-io.c
dm-ioctl.c dm ioctl: harden copy_params()'s copy_from_user() from malicious users 2018-10-18 11:54:07 -04:00
dm-kcopyd.c dm kcopyd: avoid softlockup in run_complete_job 2018-08-08 09:16:24 -04:00
dm-linear.c block: add a report_zones method 2018-10-25 11:17:40 -06:00
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: rename DM_TYPE_MQ_REQUEST_BASED to DM_TYPE_REQUEST_BASED 2018-10-11 11:36:09 -04:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid1.c dm kcopyd: return void from dm_kcopyd_copy() 2018-07-31 17:33:21 -04:00
dm-raid.c dm raid: avoid bitmap with raid4/5/6 journal device 2018-10-18 15:13:48 -04:00
dm-region-hash.c
dm-round-robin.c
dm-rq.c dm: remove legacy request-based IO path 2018-10-11 11:36:09 -04:00
dm-rq.h dm: remove legacy request-based IO path 2018-10-11 11:36:09 -04:00
dm-service-time.c
dm-snap-persistent.c
dm-snap-transient.c
dm-snap.c dm snapshot: remove stale FIXME in snapshot_map() 2018-08-08 20:50:58 -04:00
dm-stats.c
dm-stats.h
dm-stripe.c
dm-switch.c
dm-sysfs.c dm: remove legacy request-based IO path 2018-10-11 11:36:09 -04:00
dm-table.c - Biggest change this cycle is to remove support for the legacy IO path 2018-10-26 12:57:38 -07:00
dm-target.c
dm-thin-metadata.c dm thin metadata: fix __udivdi3 undefined on 32-bit 2018-09-17 11:49:34 -04:00
dm-thin-metadata.h
dm-thin.c dm thin: use refcount_t for thin_c reference counting 2018-10-16 14:27:03 -04:00
dm-uevent.c
dm-uevent.h
dm-unstripe.c
dm-verity-fec.c dm: Remove VLA usage from hashes 2018-09-14 14:08:52 +08:00
dm-verity-fec.h
dm-verity-target.c dm verity: fix crash on bufio buffer that was allocated with vmalloc 2018-09-04 11:25:25 -04:00
dm-verity.h
dm-writecache.c dm writecache: remove disabled code in memory_entry() 2018-10-22 10:59:52 -04:00
dm-zero.c
dm-zoned-metadata.c dm zoned: fix various dmz_get_mblock() issues 2018-10-18 15:17:03 -04:00
dm-zoned-reclaim.c dm kcopyd: return void from dm_kcopyd_copy() 2018-07-31 17:33:21 -04:00
dm-zoned-target.c dm zoned: Fix target BIO completion handling 2018-12-07 16:04:31 -05:00
dm-zoned.h
dm.c dm: call blk_queue_split() to impose device limits on bios 2018-12-07 16:04:22 -05:00
dm.h dm: remove legacy request-based IO path 2018-10-11 11:36:09 -04:00
Kconfig dm: remove legacy request-based IO path 2018-10-11 11:36:09 -04:00
Makefile
md-bitmap.c md/bitmap: use mddev_suspend/resume instead of ->quiesce() 2018-10-10 11:03:34 -07:00
md-bitmap.h md: Avoid namespace collision with bitmap API 2018-08-01 15:49:39 -07:00
md-cluster.c md-cluster: remove suspend_info 2018-10-18 09:41:25 -07:00
md-cluster.h md-cluster: introduce resync_info_get interface for sanity check 2018-10-18 09:36:35 -07:00
md-faulty.c
md-linear.c
md-linear.h
md-multipath.c
md-multipath.h
md.c MD: Memory leak when flush bio size is zero 2018-10-22 09:15:26 -07:00
md.h md-cluster/raid10: support add disk under grow mode 2018-10-18 09:34:56 -07:00
raid0.c blkcg: revert blkcg cleanups series 2018-11-01 19:59:53 -06:00
raid0.h
raid1-10.c
raid1.c MD: fix invalid stored role for a disk - try2 2018-10-14 17:05:07 -07:00
raid1.h
raid5-cache.c md: remove redundant code that is no longer reachable 2018-10-10 10:45:15 -07:00
raid5-log.h md/raid5-cache: disable reshape completely 2018-08-31 17:38:09 -07:00
raid5-ppl.c
raid5.c raid5: block failing device if raid will be failed 2018-09-28 11:13:15 -07:00
raid5.h
raid10.c md-cluster: introduce resync_info_get interface for sanity check 2018-10-18 09:36:35 -07:00
raid10.h