Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ore: Fix crash in case of an IO error.

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.

[Bug in 3.2.0 Kernel]
CC: Stable Tree <stable@kernel.org>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>

+3 -3
+3 -3
fs/exofs/ore.c
··· 445 445 u64 residual = ios->reading ? 446 446 or->in.residual : or->out.residual; 447 447 u64 offset = (ios->offset + ios->length) - residual; 448 - struct ore_dev *od = ios->oc->ods[ 449 - per_dev->dev - ios->oc->first_dev]; 448 + unsigned dev = per_dev->dev - ios->oc->first_dev; 449 + struct ore_dev *od = ios->oc->ods[dev]; 450 450 451 - on_dev_error(ios, od, per_dev->dev, osi.osd_err_pri, 451 + on_dev_error(ios, od, dev, osi.osd_err_pri, 452 452 offset, residual); 453 453 } 454 454 if (osi.osd_err_pri >= acumulated_osd_err) {