]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-small_fixes.patch
- fix brokeness in raid0 code
[packages/kernel.git] / kernel-small_fixes.patch
1 --- linux-2.6.33/scripts/mod/modpost.c~ 2010-02-24 19:52:17.000000000 +0100
2 +++ linux-2.6.33/scripts/mod/modpost.c  2010-03-07 14:26:47.242168558 +0100
3 @@ -15,7 +15,8 @@
4  #include <stdio.h>
5  #include <ctype.h>
6  #include "modpost.h"
7 -#include "../../include/generated/autoconf.h"
8 +// PLD architectures don't use CONFIG_SYMBOL_PREFIX
9 +//#include "../../include/generated/autoconf.h"
10  #include "../../include/linux/license.h"
11  
12  /* Some toolchains use a `_' prefix for all user symbols. */
13
14 --- linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh~       2011-07-22 04:17:23.000000000 +0200
15 +++ linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh        2011-08-25 21:26:04.799150642 +0200
16 @@ -9,6 +9,12 @@
17                         $cc -print-file-name=lib${lib}.${ext} | grep -q /
18                         if [ $? -eq 0 ]; then
19                                 echo "-l${lib}"
20 +                               for libt in tinfow tinfo ; do
21 +                                       $cc -print-file-name=lib${libt}.${ext} | grep -q /
22 +                                       if [ $? -eq 0 ]; then
23 +                                               echo "-l${libt}"
24 +                                       fi
25 +                               done
26                                 exit
27                         fi
28                 done
29 From a81157768a00e8cf8a7b43b5ea5cac931262374f Mon Sep 17 00:00:00 2001
30 From: Eric Work <work.eric@gmail.com>
31 Date: Mon, 18 May 2015 23:26:23 -0700
32 Subject: md/raid0: fix restore to sector variable in raid0_make_request
33
34 The variable "sector" in "raid0_make_request()" was improperly updated
35 by a call to "sector_div()" which modifies its first argument in place.
36 Commit 47d68979cc968535cb87f3e5f2e6a3533ea48fbd restored this variable
37 after the call for later re-use.  Unfortunetly the restore was done after
38 the referenced variable "bio" was advanced.  This lead to the original
39 value and the restored value being different.  Here we move this line to
40 the proper place.
41
42 One observed side effect of this bug was discarding a file though
43 unlinking would cause an unrelated file's contents to be discarded.
44
45 Signed-off-by: NeilBrown <neilb@suse.de>
46 Fixes: 47d68979cc96 ("md/raid0: fix bug with chunksize not a power of 2.")
47 Cc: stable@vger.kernel.org (any that received above backport)
48 URL: https://bugzilla.kernel.org/show_bug.cgi?id=98501
49
50 diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
51 index 6a68ef5..efb654e 100644
52 --- a/drivers/md/raid0.c
53 +++ b/drivers/md/raid0.c
54 @@ -524,6 +524,9 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
55                          ? (sector & (chunk_sects-1))
56                          : sector_div(sector, chunk_sects));
57  
58 +               /* Restore due to sector_div */
59 +               sector = bio->bi_iter.bi_sector;
60 +
61                 if (sectors < bio_sectors(bio)) {
62                         split = bio_split(bio, sectors, GFP_NOIO, fs_bio_set);
63                         bio_chain(split, bio);
64 @@ -531,7 +534,6 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
65                         split = bio;
66                 }
67  
68 -               sector = bio->bi_iter.bi_sector;
69                 zone = find_zone(mddev->private, &sector);
70                 tmp_dev = map_sector(mddev, zone, sector, &sector);
71                 split->bi_bdev = tmp_dev->bdev;
72 -- 
73 cgit v0.10.2
74
This page took 0.087444 seconds and 3 git commands to generate.