]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/md-raid1-chunksize
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / md-raid1-chunksize
1 From: NeilBrown <neilb@suse.de>
2 Subject: Don't fail to start a RAID1 with a small chunksize
3 Patch-mainline: no
4 References: 459557
5
6 For a RAID1 array, chunksize is almost meaningless (it is used to
7 round down the device size to a multiple of chunksize, but that is
8 largely of historical interest).
9 However it is possible to set the chunksize, and it is possible to
10 set it to be less than PAGE_SIZE. This currently causes the
11 array to fail to start. However there is no good reason for that.
12 And YaST seems to create RAID1 arrays with a 4K chunks which breaks
13 on PPC-64 machines with 64K pages.
14
15 So ignore the "chunk_size < PAGE_SIZE" check on RAID1 like we do
16 for RAID0
17
18 Signed-off-by: Neil Brown <neilb@suse.de>
19
20 ---
21 drivers/md/md.c | 6 +++---
22 1 file changed, 3 insertions(+), 3 deletions(-)
23
24 --- a/drivers/md/md.c
25 +++ b/drivers/md/md.c
26 @@ -3587,13 +3587,13 @@ static int do_md_run(mddev_t * mddev)
27 return -EINVAL;
28 }
29 if (chunk_size < PAGE_SIZE) {
30 - if (mddev->level) {
31 + if (mddev->level != 0 && mddev->level != 1) {
32 printk(KERN_ERR "too small chunk_size: %d < %ld\n",
33 chunk_size, PAGE_SIZE);
34 return -EINVAL;
35 } else {
36 - printk(KERN_ERR "too small chunk_size: %d < %ld, but continuing anyway on raid0. Good luck!\n",
37 - chunk_size, PAGE_SIZE);
38 + printk(KERN_ERR "too small chunk_size: %d < %ld, but continuing anyway on raid%d. Good luck!\n",
39 + chunk_size, PAGE_SIZE, mddev->level);
40 }
41 }
42