]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.14/0066-md-bitmap-ensure-to-load-bitmap-when-creating-via-sy.patch
linux-ti335x-psp 3.2: update to 3.2.14
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.14 / 0066-md-bitmap-ensure-to-load-bitmap-when-creating-via-sy.patch
1 From 850bfe24a75251acf10ad9dbacd4bc750005fd1b Mon Sep 17 00:00:00 2001
2 From: NeilBrown <neilb@suse.de>
3 Date: Mon, 19 Mar 2012 12:46:37 +1100
4 Subject: [PATCH 066/147] md/bitmap: ensure to load bitmap when creating via
5  sysfs.
7 commit 4474ca42e2577563a919fd3ed782e2ec55bf11a2 upstream.
9 When commit 69e51b449d383e (md/bitmap:  separate out loading a bitmap...)
10 created bitmap_load, it missed calling it after bitmap_create when a
11 bitmap is created through the sysfs interface.
12 So if a bitmap is added this way, we don't allocate memory properly
13 and can crash.
15 This is suitable for any -stable release since 2.6.35.
16 Signed-off-by: NeilBrown <neilb@suse.de>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 ---
19  drivers/md/bitmap.c |    2 ++
20  1 file changed, 2 insertions(+)
22 diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
23 index 6d03774..2a8722b 100644
24 --- a/drivers/md/bitmap.c
25 +++ b/drivers/md/bitmap.c
26 @@ -1904,6 +1904,8 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
27                         if (mddev->pers) {
28                                 mddev->pers->quiesce(mddev, 1);
29                                 rv = bitmap_create(mddev);
30 +                               if (!rv)
31 +                                       rv = bitmap_load(mddev);
32                                 if (rv) {
33                                         bitmap_destroy(mddev);
34                                         mddev->bitmap_info.offset = 0;
35 -- 
36 1.7.9.4