[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.1 / 0019-ore-Fix-crash-in-case-of-an-IO-error.patch
1 From babc031c2b450518ffb3ffc6a5ae1b02799a7af3 Mon Sep 17 00:00:00 2001
2 From: Boaz Harrosh <bharrosh@panasas.com>
3 Date: Tue, 27 Dec 2011 19:23:36 +0200
4 Subject: [PATCH 19/49] ore: Fix crash in case of an IO error.
6 commit ffefb8eaa367e8a5c14f779233d9da1fbc23d164 upstream.
8 The users of ore_check_io() expect the reported device
9 (In case of error) to be indexed relative to the passed-in
10 ore_components table, and not the logical dev index.
12 This causes a crash inside objlayoutdriver in case of
13 an IO error.
15 Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 ---
18 fs/exofs/ore.c | 6 +++---
19 1 file changed, 3 insertions(+), 3 deletions(-)
21 diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c
22 index d271ad8..894f3e1 100644
23 --- a/fs/exofs/ore.c
24 +++ b/fs/exofs/ore.c
25 @@ -445,10 +445,10 @@ int ore_check_io(struct ore_io_state *ios, ore_on_dev_error on_dev_error)
26 u64 residual = ios->reading ?
27 or->in.residual : or->out.residual;
28 u64 offset = (ios->offset + ios->length) - residual;
29 - struct ore_dev *od = ios->oc->ods[
30 - per_dev->dev - ios->oc->first_dev];
31 + unsigned dev = per_dev->dev - ios->oc->first_dev;
32 + struct ore_dev *od = ios->oc->ods[dev];
34 - on_dev_error(ios, od, per_dev->dev, osi.osd_err_pri,
35 + on_dev_error(ios, od, dev, osi.osd_err_pri,
36 offset, residual);
37 }
38 if (osi.osd_err_pri >= acumulated_osd_err) {
39 --
40 1.7.9.4