]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.suse/md-raid-metadata-PAGE_SIZE.patch
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.suse / md-raid-metadata-PAGE_SIZE.patch
1 Subject: [Bug 429490] sles10 raid0 can not be started
2 From: bugzilla_noreply@novell.com
3
4 ### Comment #4 from Neil Brown <nfbrown@novell.com> 2008-10-08 17:34:49 MDT ---
5 The md code was written with the expectation that the chunk size would
6 always be at least one page. This may not always be a strict requirement,
7 but I guess that test protects against untested code.
8
9 For raid4/5/6, the stripe-cache is stored as pages so a chunk size
10 less than one page would certainly cause problems with the current code.
11
12 For raid0, I think a smaller chunk size should work.
13 The filesystem is always allowed to send down one-page requests, and
14 if the chunk size is less than that page size, these requests will have
15 to be split up, possibly multiple times. However I think the code will
16 get this right - it has only actually be used for page-sized requests
17 that are not page-aligned.
18
19 You could try changing the test to
20
21 if (chunk_size < PAGE_SIZE && mddev->level != 0) {
22
23 and see how that works.
24
25 Signed-off-by: Olaf Hering <olh@suse.de>
26
27 ---
28 drivers/md/md.c | 5 +++++
29 1 file changed, 5 insertions(+)
30
31 --- a/drivers/md/md.c
32 +++ b/drivers/md/md.c
33 @@ -3587,9 +3587,14 @@ static int do_md_run(mddev_t * mddev)
34 return -EINVAL;
35 }
36 if (chunk_size < PAGE_SIZE) {
37 + if (mddev->level) {
38 printk(KERN_ERR "too small chunk_size: %d < %ld\n",
39 chunk_size, PAGE_SIZE);
40 return -EINVAL;
41 + } else {
42 + printk(KERN_ERR "too small chunk_size: %d < %ld, but continuing anyway on raid0. Good luck!\n",
43 + chunk_size, PAGE_SIZE);
44 + }
45 }
46
47 /* devices must have minimum size of one chunk */