]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/0027-md-improve-errno-return-when-setting-array_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.fixes / 0027-md-improve-errno-return-when-setting-array_size.patch
1 From 2b69c83924396ad1eda36fdd267c9d2f360f5555 Mon Sep 17 00:00:00 2001
2 From: NeilBrown <neilb@suse.de>
3 Date: Tue, 26 May 2009 09:41:17 +1000
4 Subject: [PATCH] md: improve errno return when setting array_size
5
6 Instead of always returns EINVAL if anything goes wrong
7 when setting the array size, add the option of
8 E2BIG
9 if the size requested is too large. This makes it easier
10 for user-space to be sure what went wrong.
11
12 Signed-off-by: NeilBrown <neilb@suse.de>
13 ---
14 drivers/md/md.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17 --- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c
18 +++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c
19 @@ -3449,7 +3449,7 @@ array_size_store(mddev_t *mddev, const c
20 if (strict_blocks_to_sectors(buf, &sectors) < 0)
21 return -EINVAL;
22 if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors)
23 - return -EINVAL;
24 + return -E2BIG;
25
26 mddev->external_size = 1;
27 }