[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.20 / 0005-exofs-Fix-CRASH-on-very-early-IO-errors.patch
1 From afd117116e98d0444a0ace7d152207a54cc15ff5 Mon Sep 17 00:00:00 2001
2 From: Boaz Harrosh <bharrosh@panasas.com>
3 Date: Wed, 16 May 2012 14:22:21 +0300
4 Subject: [PATCH 05/86] exofs: Fix CRASH on very early IO errors.
6 commit 6abe4a87f7bc7978705c386dbba0ca0c7790b3ec upstream.
8 If at exofs_fill_super() we had an early termination
9 do to any error, like an IO error while reading the
10 super-block. We would crash inside exofs_free_sbi().
12 This is because sbi->oc.numdevs was set to 1, before
13 we actually have a device table at all.
15 Fix it by moving the sbi->oc.numdevs = 1 to after the
16 allocation of the device table.
18 Reported-by: Johannes Schild <JSchild@gmx.de>
20 Stable: This is a bug since v3.2.0
21 Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
22 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23 ---
24 fs/exofs/super.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
27 diff --git a/fs/exofs/super.c b/fs/exofs/super.c
28 index e6085ec..7ed5000 100644
29 --- a/fs/exofs/super.c
30 +++ b/fs/exofs/super.c
31 @@ -745,7 +745,6 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
32 sbi->one_comp.obj.partition = opts->pid;
33 sbi->one_comp.obj.id = 0;
34 exofs_make_credential(sbi->one_comp.cred, &sbi->one_comp.obj);
35 - sbi->oc.numdevs = 1;
36 sbi->oc.single_comp = EC_SINGLE_COMP;
37 sbi->oc.comps = &sbi->one_comp;
39 @@ -803,6 +802,7 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
40 goto free_sbi;
42 ore_comp_set_dev(&sbi->oc, 0, od);
43 + sbi->oc.numdevs = 1;
44 }
46 __sbi_read_stats(sbi);
47 --
48 1.7.9.5