diff options
author | Song Liu <[email protected]> | 2023-11-17 15:56:30 -0800 |
---|---|---|
committer | Song Liu <[email protected]> | 2023-11-19 20:51:25 -0800 |
commit | 45b478951b2ba5aea70b2850c49c1aa83aedd0d2 (patch) | |
tree | c55cc466698b1616ec538c285744e301feb8ce01 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | e63a57303599b17290cd8bc48e6f20b24289a8bc (diff) |
md: fix bi_status reporting in md_end_clone_io
md_end_clone_io() may overwrite error status in orig_bio->bi_status with
BLK_STS_OK. This could happen when orig_bio has BIO_CHAIN (split by
md_submit_bio => bio_split_to_limits, for example). As a result, upper
layer may miss error reported from md (or the device) and consider the
failed IO was successful.
Fix this by only update orig_bio->bi_status when current bio reports
error and orig_bio is BLK_STS_OK. This is the same behavior as
__bio_chain_endio().
Fixes: 10764815ff47 ("md: add io accounting for raid0 and raid5")
Cc: [email protected] # v5.14+
Reported-by: Bhanu Victor DiCara <[email protected]>
Closes: https://lore.kernel.org/regressions/5727380.DvuYhMxLoT@bvd0/
Signed-off-by: Song Liu <[email protected]>
Tested-by: Xiao Ni <[email protected]>
Reviewed-by: Yu Kuai <[email protected]>
Acked-by: Guoqing Jiang <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions