Don't jump to compute_result state from check_result state
Nigel Croxon authored
commit 4f4fd7c5 upstream.

Changing state from check_state_check_result to
check_state_compute_result not only is unsafe but also doesn't
appear to serve a valid purpose.  A raid6 check should only be
pushing out extra writes if doing repair and a mis-match occurs.
The stripe dev management will already try and do repair writes
for failing sectors.

This patch makes the raid6 check_state_check_result handling
work more like raid5's.  If somehow too many failures for a
check, just quit the check operation for the stripe.  When any
checks pass, don't try and use check_state_compute_result for
a purpose it isn't needed for and is unsafe for.  Just mark the
stripe as in sync for passing its parity checks and let the
stripe dev read/write code and the bad blocks list do their
job handling I/O errors.

Repro steps from Xiao:

These are the steps to reproduce this problem:
1. redefined OPT_MEDIUM_ERR_ADDR to 12000 in scsi_...
9a55bb2f
Name Last commit Last update
Documentation x86/speculation/mds: Fix documentation typo
arch x86/kprobes: Avoid kretprobe recursion bug
block block: do not leak memory in bio_copy_user_iov()
certs Replace magic for trusting the secondary keyring with #define
crypto crypto: x86/poly1305 - fix overflow during partial reduction
drivers Don't jump to compute_result state from check_result state
firmware License cleanup: add SPDX GPL-2.0 license identifier to files with no license
fs cifs: fix memory leak in SMB2_read
include nfc: nci: Potential off by one in ->pipes[] array
init init: initialize jump labels before command line option parsing
ipc ipc/sem.c: prevent queue.status tearing in semop
kernel tracing/fgraph: Fix set_graph_function from showing interrupts
lib ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings
mm mm/memory.c: fix modifying of page protection by insert_pfn()
net NFC: nci: Add some bounds checking in nci_hci_cmd_received()
samples samples: mei: use /dev/mei0 instead of /dev/mei
scripts kconfig/[mn]conf: handle backspace (^H) key
security ima: open a new file instance if no read permissions
sound ASoC: Intel: avoid Oops if DMA setup fails
tools selftests/net: correct the return value for run_netsocktests
usr initramfs: fix initramfs rebuilds w/ compression after disabling
virt KVM: arm/arm64: Ensure only THP is candidate for adjustment
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.