raid5: Set R5_Expanded on parity devices as well as data.
NeilBrown authored
[ Upstream commit 235b6003

 ]

When reshaping a fully degraded raid5/raid6 to a larger
nubmer of devices, the new device(s) are not in-sync
and so that can make the newly grown stripe appear to be
"failed".
To avoid this, we set the R5_Expanded flag to say "Even though
this device is not fully in-sync, this block is safe so
don't treat the device as failed for this stripe".
This flag is set for data devices, not not for parity devices.

Consequently, if you have a RAID6 with two devices that are partly
recovered and a spare, and start a reshape to include the spare,
then when the reshape gets past the point where the recovery was
up to, it will think the stripes are failed and will get into
an infinite loop, failing to make progress.

So when contructing parity on an EXPAND_READY stripe,
set R5_Expanded.
Reported-by: default avatarCurt <lightspd@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
f39486bd
Name Last commit Last update
..
bcache bcache: fix wrong cache_misses statistics
persistent-data dm space map disk: fix some book keeping in the disk space map
Kconfig dm raid: select the Kconfig option CONFIG_MD_RAID0
Makefile dm: move request-based code out to dm-rq.[hc]
bitmap.c md: free unused memory after bitmap resize
bitmap.h md-cluster: sync bitmap when node received RESYNCING msg
dm-bio-prison.c block: add a bi_error field to struct bio
dm-bio-prison.h dm bio prison: add dm_cell_promote_or_release()
dm-bio-record.h dm: Refactor for new bio cloning/splitting
dm-bufio.c dm bufio: fix integer overflow when limiting maximum cache size
dm-bufio.h dm snapshot: use dm-bufio prefetch
dm-builtin.c dm: move request-based code out to dm-rq.[hc]
dm-cache-block-types.h dm cache: revert "remove remainder of distinct discard block size"
dm-cache-metadata.c dm cache metadata: fail operations if fail_io mode has been established
dm-cache-metadata.h dm cache: make sure every metadata function checks fail_io
dm-cache-policy-cleaner.c dm cache: speed up writing of the hint array
dm-cache-policy-internal.h dm cache: speed up writing of the hint array
dm-cache-policy-smq.c dm cache policy smq: distribute entries to random levels when switching to smq
dm-cache-policy.c dm cache: add policy name to status output
dm-cache-policy.h dm cache: speed up writing of the hint array
dm-cache-target.c dm cache: fix corruption seen when using cache > 2TB
dm-core.h dm: allocate struct mapped_device with kvzalloc
dm-crypt.c dm crypt: mark key as invalid until properly loaded
dm-delay.c dm: rename target's per_bio_data_size to per_io_data_size
dm-era-target.c dm era: save spacemap metadata root after the pre-commit
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-rq.c
dm-rq.h
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-uevent.c
dm-uevent.h
dm-verity-fec.c
dm-verity-fec.h
dm-verity-target.c
dm-verity.h
dm-zero.c
dm.c
dm.h
faulty.c
linear.c
linear.h
md-cluster.c
md-cluster.h
md.c
md.h
multipath.c
multipath.h
raid0.c
raid0.h
raid1.c
raid1.h
raid10.c
raid10.h
raid5-cache.c
raid5.c
raid5.h