Skip to content

Commit

Permalink
ore: Fix crash in case of an IO error.
Browse files Browse the repository at this point in the history
commit ffefb8e 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: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Boaz Harrosh authored and gregkh committed Jan 12, 2012
1 parent 9234152 commit 6884852
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/exofs/ore.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ int ore_check_io(struct ore_io_state *ios, ore_on_dev_error on_dev_error)
u64 residual = ios->reading ?
or->in.residual : or->out.residual;
u64 offset = (ios->offset + ios->length) - residual;
struct ore_dev *od = ios->oc->ods[
per_dev->dev - ios->oc->first_dev];
unsigned 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);
}
if (osi.osd_err_pri >= acumulated_osd_err) {
Expand Down

0 comments on commit 6884852

Please sign in to comment.