Commit 68848527 authored by Boaz Harrosh's avatar Boaz Harrosh Committed by Greg Kroah-Hartman

ore: Fix crash in case of an IO error.

commit ffefb8ea upstream.

The users of ore_check_io() expect the reported device
(In case of error) to be indexed relative to the passed-in
ore_components table, and not the logical dev index.

This causes a crash inside objlayoutdriver in case of
an IO error.
Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 92341529
...@@ -445,10 +445,10 @@ int ore_check_io(struct ore_io_state *ios, ore_on_dev_error on_dev_error) ...@@ -445,10 +445,10 @@ int ore_check_io(struct ore_io_state *ios, ore_on_dev_error on_dev_error)
u64 residual = ios->reading ? u64 residual = ios->reading ?
or->in.residual : or->out.residual; or->in.residual : or->out.residual;
u64 offset = (ios->offset + ios->length) - residual; u64 offset = (ios->offset + ios->length) - residual;
struct ore_dev *od = ios->oc->ods[ unsigned dev = per_dev->dev - ios->oc->first_dev;
per_dev->dev - ios->oc->first_dev]; struct ore_dev *od = ios->oc->ods[dev];
on_dev_error(ios, od, per_dev->dev, osi.osd_err_pri, on_dev_error(ios, od, dev, osi.osd_err_pri,
offset, residual); offset, residual);
} }
if (osi.osd_err_pri >= acumulated_osd_err) { if (osi.osd_err_pri >= acumulated_osd_err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment