From: Yang Sheng Date: Tue, 15 Aug 2017 10:42:09 +0000 (+0800) Subject: LU-9814 ldiskfs: restore simple_strtol in prealloc X-Git-Tag: 2.10.55~38 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=685ef61f0fb9849e3f7a32c4ebf2980d3300afb0 LU-9814 ldiskfs: restore simple_strtol in prealloc Since kstrtol needs a null-terminor string so we back to use simple_strtol in prealloc patches. Signed-off-by: Yang Sheng Change-Id: I331308d830fbeef9c00156bb8c14b43651d66420 Reviewed-on: https://review.whamcloud.com/28553 Reviewed-by: Bob Glossman Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alexey Lyashkov Reviewed-by: Oleg Drokin --- diff --git a/ldiskfs/kernel_patches/patches/rhel7.4/ext4-prealloc.patch b/ldiskfs/kernel_patches/patches/rhel7.4/ext4-prealloc.patch index 65a5d4e..b35e038 100644 --- a/ldiskfs/kernel_patches/patches/rhel7.4/ext4-prealloc.patch +++ b/ldiskfs/kernel_patches/patches/rhel7.4/ext4-prealloc.patch @@ -49,7 +49,7 @@ Index: linux-3.10.0-514.16.1.el7.x86_64/fs/ext4/mballoc.c /* * The routine scans buddy structures (not bitmap!) from given order * to max order and tries to find big enough chunk to satisfy the req -@@ -2301,6 +2321,93 @@ static const struct seq_operations ext4_ +@@ -2301,6 +2321,90 @@ static const struct seq_operations ext4_ .show = ext4_mb_seq_groups_show, }; @@ -78,12 +78,9 @@ Index: linux-3.10.0-514.16.1.el7.x86_64/fs/ext4/mballoc.c + cur = str; + end = str + cnt; + while (cur < end) { -+ int rc; + while ((cur < end) && (*cur == ' ')) + cur++; -+ rc = kstrtol(cur, 0, &value); -+ if (rc != 0) -+ return -EINVAL; ++ value = simple_strtol(cur, &cur, 0); + if (value == 0) + break; + if (value <= prev) diff --git a/ldiskfs/kernel_patches/patches/rhel7/ext4-prealloc.patch b/ldiskfs/kernel_patches/patches/rhel7/ext4-prealloc.patch index 975e927..0e9c3ca 100644 --- a/ldiskfs/kernel_patches/patches/rhel7/ext4-prealloc.patch +++ b/ldiskfs/kernel_patches/patches/rhel7/ext4-prealloc.patch @@ -49,7 +49,7 @@ Index: linux-3.10.0-514.16.1.el7.x86_64/fs/ext4/mballoc.c /* * The routine scans buddy structures (not bitmap!) from given order * to max order and tries to find big enough chunk to satisfy the req -@@ -2301,6 +2321,93 @@ static const struct seq_operations ext4_ +@@ -2301,6 +2321,90 @@ static const struct seq_operations ext4_ .show = ext4_mb_seq_groups_show, }; @@ -78,12 +78,9 @@ Index: linux-3.10.0-514.16.1.el7.x86_64/fs/ext4/mballoc.c + cur = str; + end = str + cnt; + while (cur < end) { -+ int rc; + while ((cur < end) && (*cur == ' ')) + cur++; -+ rc = kstrtol(cur, 0, &value); -+ if (rc != 0) -+ return -EINVAL; ++ value = simple_strtol(cur, &cur, 0); + if (value == 0) + break; + if (value <= prev) diff --git a/ldiskfs/kernel_patches/patches/sles12/ext4-prealloc.patch b/ldiskfs/kernel_patches/patches/sles12/ext4-prealloc.patch index b788539..5de7cef 100644 --- a/ldiskfs/kernel_patches/patches/sles12/ext4-prealloc.patch +++ b/ldiskfs/kernel_patches/patches/sles12/ext4-prealloc.patch @@ -49,7 +49,7 @@ Index: linux-3.12.39-47.1/fs/ext4/mballoc.c /* * The routine scans buddy structures (not bitmap!) from given order * to max order and tries to find big enough chunk to satisfy the req -@@ -2285,6 +2304,93 @@ static const struct seq_operations ext4_ +@@ -2285,6 +2304,90 @@ static const struct seq_operations ext4_ .show = ext4_mb_seq_groups_show, }; @@ -78,12 +78,9 @@ Index: linux-3.12.39-47.1/fs/ext4/mballoc.c + cur = str; + end = str + cnt; + while (cur < end) { -+ int rc; + while ((cur < end) && (*cur == ' ')) + cur++; -+ rc = kstrtol(cur, 0, &value); -+ if (rc != 0) -+ return -EINVAL; ++ value = simple_strtol(cur, &cur, 0); + if (value == 0) + break; + if (value <= prev) diff --git a/ldiskfs/kernel_patches/patches/sles12sp2/ext4-prealloc.patch b/ldiskfs/kernel_patches/patches/sles12sp2/ext4-prealloc.patch index b7b6d31..cf0f42b 100644 --- a/ldiskfs/kernel_patches/patches/sles12sp2/ext4-prealloc.patch +++ b/ldiskfs/kernel_patches/patches/sles12sp2/ext4-prealloc.patch @@ -57,7 +57,7 @@ Index: linux-3.10.0-123.el7.x86_64/fs/ext4/mballoc.c /* * The routine scans buddy structures (not bitmap!) from given order * to max order and tries to find big enough chunk to satisfy the req -@@ -2263,6 +2282,91 @@ static const struct seq_operations ext4_ +@@ -2263,6 +2282,88 @@ static const struct seq_operations ext4_ .show = ext4_mb_seq_groups_show, }; @@ -84,12 +84,9 @@ Index: linux-3.10.0-123.el7.x86_64/fs/ext4/mballoc.c + cur = str; + end = str + cnt; + while (cur < end) { -+ int rc; + while ((cur < end) && (*cur == ' ')) + cur++; -+ rc = kstrtol(cur, 0, &value); -+ if (rc != 0) -+ return -EINVAL; ++ value = simple_strtol(cur, &cur, 0); + if (value == 0) + break; + if (value <= prev)