Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1258906 > unrolled thread

[PATCH v3 0/4] lib/string_helpers: fix precision issues and introduce tests

Started byVitaly Kuznetsov <vkuznets@redhat.com>
First post2015-10-29 17:40 +0100
Last post2015-10-31 01:10 +0100
Articles 17 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/4] lib/string_helpers: fix precision issues and introduce tests Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-10-29 17:40 +0100
    [PATCH v3 4/4] lib/test-string_helpers.c: add string_get_size() tests Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-10-29 17:40 +0100
      Re: [PATCH v3 4/4] lib/test-string_helpers.c: add string_get_size() tests Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-10-29 22:40 +0100
    [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-10-29 17:40 +0100
      Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for  string_get_size() interface James Bottomley <jbottomley@odin.com> - 2015-10-29 23:30 +0100
        Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-10-30 00:20 +0100
          Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-10-30 00:30 +0100
          Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for  string_get_size() interface James Bottomley <jbottomley@odin.com> - 2015-10-30 04:40 +0100
        Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-10-30 11:50 +0100
          Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for  string_get_size() interface James Bottomley <jbottomley@odin.com> - 2015-10-31 01:30 +0100
    [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0 Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-10-29 17:40 +0100
      Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size()  against blk_size=0 Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-10-29 22:30 +0100
      Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size()  against blk_size=0 James Bottomley <jbottomley@odin.com> - 2015-10-30 00:10 +0100
        Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size()  against blk_size=0 Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-10-30 00:40 +0100
          Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size()  against blk_size=0 James Bottomley <jbottomley@odin.com> - 2015-10-30 04:40 +0100
            Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0 Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-10-30 11:50 +0100
              Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size()  against blk_size=0 James Bottomley <jbottomley@odin.com> - 2015-10-31 01:10 +0100

#1258906 — [PATCH v3 0/4] lib/string_helpers: fix precision issues and introduce tests

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-10-29 17:40 +0100
Subject[PATCH v3 0/4] lib/string_helpers: fix precision issues and introduce tests
Message-ID<qoYp3-2B4-3@gated-at.bofh.it>
Linux always lies about your storage size when it has 4k sectors and its
size is big enough. E.g. a device with 8192 4k sectors will be reported as
"32.7 MB/32 MiB" while "33.5 MB/32 MiB" is expected. This series is
supposed to fix the issue by fixing calculation precision in
string_get_size() for all possible inputs.

PATCH 1/4 is a preparatory change, PATCH 2/4 adds additional protection
against blk_size=0 (nobody is supposed to call string_get_size() with
with blk_size=0, but better safe than sorry), PATCH 3/4 re-factors
string_get_size() fixing the issue, PATCH 4/4 introduces tests for
string_get_size().

PATCH 4/4 was previously sent as part of "lib/string_helpers.c: fix
infinite loop in string_get_size()" series but it is still not merged
upstream. In this submission I improve it and add additional tests to it.

Changes since v2:
- Separate blk_size check from Patch 3/4 to new Patch 2/4 [Andy Shevchenko]
- Slightly change the algorithm in Patch 3/4 [Rasmus Villemoes]

Vitaly Kuznetsov (4):
  lib/string_helpers: change blk_size to u32 for string_get_size()
    interface
  lib/string_helpers.c: protect string_get_size() against blk_size=0
  lib/string_helpers.c: don't lose precision in string_get_size()
  lib/test-string_helpers.c: add string_get_size() tests

 include/linux/string_helpers.h |  2 +-
 lib/string_helpers.c           | 38 ++++++++++++++-------------
 lib/test-string_helpers.c      | 58 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 79 insertions(+), 19 deletions(-)

-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1258907 — [PATCH v3 4/4] lib/test-string_helpers.c: add string_get_size() tests

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-10-29 17:40 +0100
Subject[PATCH v3 4/4] lib/test-string_helpers.c: add string_get_size() tests
Message-ID<qoYp3-2B4-5@gated-at.bofh.it>
In reply to#1258906
Add a couple of simple tests for string_get_size().

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 lib/test-string_helpers.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/lib/test-string_helpers.c b/lib/test-string_helpers.c
index 8e376ef..4c77b54 100644
--- a/lib/test-string_helpers.c
+++ b/lib/test-string_helpers.c
@@ -326,6 +326,61 @@ out:
 	kfree(out_test);
 }
 
+#define string_get_size_maxbuf 16
+#define test_string_get_size_one(size, blk_size, exp_result10, exp_result2)    \
+	do {                                                                   \
+		BUILD_BUG_ON(sizeof(exp_result10) >= string_get_size_maxbuf);  \
+		BUILD_BUG_ON(sizeof(exp_result2) >= string_get_size_maxbuf);   \
+		__test_string_get_size((size), (blk_size), (exp_result10),     \
+				       (exp_result2));                         \
+	} while (0)
+
+
+static __init void __test_string_get_size(const u64 size, const u32 blk_size,
+					  const char *exp_result10,
+					  const char *exp_result2)
+{
+	char buf10[string_get_size_maxbuf];
+	char buf2[string_get_size_maxbuf];
+
+	string_get_size(size, blk_size, STRING_UNITS_10, buf10, sizeof(buf10));
+	string_get_size(size, blk_size, STRING_UNITS_2, buf2, sizeof(buf2));
+
+	if (!memcmp(buf10, exp_result10, strlen(exp_result10) + 1))
+		goto check_stringunits_2;
+
+	buf10[sizeof(buf10) - 1] = '\0';
+
+	pr_warn("Test 'test_string_get_size' failed!\n");
+	pr_warn("string_get_size(size = %llu, blk_size = %u, units = %s)\n",
+		size, blk_size, "STRING_UNITS_10");
+	pr_warn("expected: '%s', got '%s'\n", exp_result10, buf10);
+
+check_stringunits_2:
+	if (!memcmp(buf2, exp_result2, strlen(exp_result2) + 1))
+		return;
+
+	buf2[sizeof(buf2) - 1] = '\0';
+
+	pr_warn("Test 'test_string_get_size' failed!\n");
+	pr_warn("string_get_size(size = %llu, blk_size = %u, units = %s)\n",
+		size, blk_size, "STRING_UNITS_2");
+	pr_warn("expected: '%s', got '%s'\n", exp_result2, buf2);
+}
+
+static __init void test_string_get_size(void)
+{
+	test_string_get_size_one(16384, 512, "8.38 MB", "8.00 MiB");
+	test_string_get_size_one(500118192, 512, "256 GB", "238 GiB");
+	test_string_get_size_one(8192, 4096, "33.5 MB", "32.0 MiB");
+	test_string_get_size_one(1100, 1, "1.10 kB", "1.07 KiB");
+	test_string_get_size_one(3000, 1900, "5.70 MB", "5.43 MiB");
+	test_string_get_size_one(U64_MAX, 4096, "75.5 ZB", "63.9 ZiB");
+	test_string_get_size_one(1999, U32_MAX, "8.58 TB", "7.80 TiB");
+	test_string_get_size_one(1, 512, "512 B", "512 B");
+	test_string_get_size_one(0, 512, "0 B", "0 B");
+}
+
 static int __init test_string_helpers_init(void)
 {
 	unsigned int i;
@@ -344,6 +399,9 @@ static int __init test_string_helpers_init(void)
 	for (i = 0; i < (ESCAPE_ANY_NP | ESCAPE_HEX) + 1; i++)
 		test_string_escape("escape 1", escape1, i, TEST_STRING_2_DICT_1);
 
+	/* Test string_get_size() */
+	test_string_get_size();
+
 	return -EINVAL;
 }
 module_init(test_string_helpers_init);
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259027 — Re: [PATCH v3 4/4] lib/test-string_helpers.c: add string_get_size() tests

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2015-10-29 22:40 +0100
SubjectRe: [PATCH v3 4/4] lib/test-string_helpers.c: add string_get_size() tests
Message-ID<qp35q-5yq-51@gated-at.bofh.it>
In reply to#1258907
On Thu, Oct 29, 2015 at 6:30 PM, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
> Add a couple of simple tests for string_get_size().
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
>  lib/test-string_helpers.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 58 insertions(+)
>
> diff --git a/lib/test-string_helpers.c b/lib/test-string_helpers.c
> index 8e376ef..4c77b54 100644
> --- a/lib/test-string_helpers.c
> +++ b/lib/test-string_helpers.c
> @@ -326,6 +326,61 @@ out:
>         kfree(out_test);
>  }
>
> +#define string_get_size_maxbuf 16
> +#define test_string_get_size_one(size, blk_size, exp_result10, exp_result2)    \
> +       do {                                                                   \
> +               BUILD_BUG_ON(sizeof(exp_result10) >= string_get_size_maxbuf);  \
> +               BUILD_BUG_ON(sizeof(exp_result2) >= string_get_size_maxbuf);   \
> +               __test_string_get_size((size), (blk_size), (exp_result10),     \
> +                                      (exp_result2));                         \
> +       } while (0)
> +
> +
> +static __init void __test_string_get_size(const u64 size, const u32 blk_size,
> +                                         const char *exp_result10,
> +                                         const char *exp_result2)
> +{
> +       char buf10[string_get_size_maxbuf];
> +       char buf2[string_get_size_maxbuf];
> +
> +       string_get_size(size, blk_size, STRING_UNITS_10, buf10, sizeof(buf10));
> +       string_get_size(size, blk_size, STRING_UNITS_2, buf2, sizeof(buf2));
> +
> +       if (!memcmp(buf10, exp_result10, strlen(exp_result10) + 1))
> +               goto check_stringunits_2;
> +

> +       buf10[sizeof(buf10) - 1] = '\0';
> +
> +       pr_warn("Test 'test_string_get_size' failed!\n");
> +       pr_warn("string_get_size(size = %llu, blk_size = %u, units = %s)\n",
> +               size, blk_size, "STRING_UNITS_10");
> +       pr_warn("expected: '%s', got '%s'\n", exp_result10, buf10);

Looks to me as a helper function

test_string_get_size_pr_err(size, blk_size, units, exp_result, buf, buflen) {}

if (memcmp(buf10, exp_result10, strlen(exp_result10) + 1))
 _pr_err(...);

> +
> +check_stringunits_2:
> +       if (!memcmp(buf2, exp_result2, strlen(exp_result2) + 1))
> +               return;
> +
> +       buf2[sizeof(buf2) - 1] = '\0';
> +
> +       pr_warn("Test 'test_string_get_size' failed!\n");
> +       pr_warn("string_get_size(size = %llu, blk_size = %u, units = %s)\n",
> +               size, blk_size, "STRING_UNITS_2");
> +       pr_warn("expected: '%s', got '%s'\n", exp_result2, buf2);
> +}
> +
> +static __init void test_string_get_size(void)
> +{
> +       test_string_get_size_one(16384, 512, "8.38 MB", "8.00 MiB");
> +       test_string_get_size_one(500118192, 512, "256 GB", "238 GiB");
> +       test_string_get_size_one(8192, 4096, "33.5 MB", "32.0 MiB");
> +       test_string_get_size_one(1100, 1, "1.10 kB", "1.07 KiB");
> +       test_string_get_size_one(3000, 1900, "5.70 MB", "5.43 MiB");
> +       test_string_get_size_one(U64_MAX, 4096, "75.5 ZB", "63.9 ZiB");
> +       test_string_get_size_one(1999, U32_MAX, "8.58 TB", "7.80 TiB");
> +       test_string_get_size_one(1, 512, "512 B", "512 B");
> +       test_string_get_size_one(0, 512, "0 B", "0 B");

> +}
> +
>  static int __init test_string_helpers_init(void)
>  {
>         unsigned int i;
> @@ -344,6 +399,9 @@ static int __init test_string_helpers_init(void)
>         for (i = 0; i < (ESCAPE_ANY_NP | ESCAPE_HEX) + 1; i++)
>                 test_string_escape("escape 1", escape1, i, TEST_STRING_2_DICT_1);
>
> +       /* Test string_get_size() */
> +       test_string_get_size();
> +
>         return -EINVAL;
>  }
>  module_init(test_string_helpers_init);
> --
> 2.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1258910 — [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-10-29 17:40 +0100
Subject[PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface
Message-ID<qoYp4-2B4-17@gated-at.bofh.it>
In reply to#1258906
string_get_size() can't really handle huge block sizes, especially
blk_size > U32_MAX but string_get_size() interface states the opposite.
Change blk_size from u64 to u32 to reflect the reality.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 include/linux/string_helpers.h | 2 +-
 lib/string_helpers.c           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index dabe643..1223e80 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -10,7 +10,7 @@ enum string_size_units {
 	STRING_UNITS_2,		/* use binary powers of 2^10 */
 };
 
-void string_get_size(u64 size, u64 blk_size, enum string_size_units units,
+void string_get_size(u64 size, u32 blk_size, enum string_size_units units,
 		     char *buf, int len);
 
 #define UNESCAPE_SPACE		0x01
diff --git a/lib/string_helpers.c b/lib/string_helpers.c
index 5939f63..f6c27dc 100644
--- a/lib/string_helpers.c
+++ b/lib/string_helpers.c
@@ -26,7 +26,7 @@
  * at least 9 bytes and will always be zero terminated.
  *
  */
-void string_get_size(u64 size, u64 blk_size, const enum string_size_units units,
+void string_get_size(u64 size, u32 blk_size, const enum string_size_units units,
 		     char *buf, int len)
 {
 	static const char *const units_10[] = {
@@ -58,7 +58,7 @@ void string_get_size(u64 size, u64 blk_size, const enum string_size_units units,
 		i++;
 	}
 
-	exp = divisor[units] / (u32)blk_size;
+	exp = divisor[units] / blk_size;
 	/*
 	 * size must be strictly greater than exp here to ensure that remainder
 	 * is greater than divisor[units] coming out of the if below.
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259054 — Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface

FromJames Bottomley <jbottomley@odin.com>
Date2015-10-29 23:30 +0100
SubjectRe: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface
Message-ID<qp3RN-64M-57@gated-at.bofh.it>
In reply to#1258910
T24gVGh1LCAyMDE1LTEwLTI5IGF0IDE3OjMwICswMTAwLCBWaXRhbHkgS3V6bmV0c292IHdyb3Rl
Og0KPiBzdHJpbmdfZ2V0X3NpemUoKSBjYW4ndCByZWFsbHkgaGFuZGxlIGh1Z2UgYmxvY2sgc2l6
ZXMsIGVzcGVjaWFsbHkNCj4gYmxrX3NpemUgPiBVMzJfTUFYIGJ1dCBzdHJpbmdfZ2V0X3NpemUo
KSBpbnRlcmZhY2Ugc3RhdGVzIHRoZSBvcHBvc2l0ZS4NCj4gQ2hhbmdlIGJsa19zaXplIGZyb20g
dTY0IHRvIHUzMiB0byByZW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CWV4cCA9
IGRpdmlzb3JbdW5pdHNdIC8gKHUzMilibGtfc2l6ZTsNCj4gKwlleHAgPSBkaXZpc29yW3VuaXRz
XSAvIGJsa19zaXplOw0KPiAgCS8qDQo+ICAJICogc2l6ZSBtdXN0IGJlIHN0cmljdGx5IGdyZWF0
ZXIgdGhhbiBleHAgaGVyZSB0byBlbnN1cmUgdGhhdCByZW1haW5kZXINCj4gIAkgKiBpcyBncmVh
dGVyIHRoYW4gZGl2aXNvclt1bml0c10gY29taW5nIG91dCBvZiB0aGUgaWYgYmVsb3cuDQoNCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259092 — Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface

FromRasmus Villemoes <linux@rasmusvillemoes.dk>
Date2015-10-30 00:20 +0100
SubjectRe: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface
Message-ID<qp4Ea-6CA-5@gated-at.bofh.it>
In reply to#1259054
On Thu, Oct 29 2015, James Bottomley <jbottomley@odin.com> wrote:

> On Thu, 2015-10-29 at 17:30 +0100, Vitaly Kuznetsov wrote:
>> string_get_size() can't really handle huge block sizes, especially
>> blk_size > U32_MAX but string_get_size() interface states the opposite.
>> Change blk_size from u64 to u32 to reflect the reality.
>
> What is the actual evidence for this?  The calculation is designed to be
> a symmetric 128 bit multiply.  When I wrote and tested it, it worked
> fine for huge block sizes.
>

May I politely ask how you tested it, and what you mean by "worked"? The
bug I reported last week was particularly concerning block sizes >= 1024
(e.g. the 32768, 1024 pair giving 32.7 MB where the correct output would
be 33.5 MB). Now it turns out that it was actually broken for smaller
block sizes as well. For ~13000 semirandom size,blk_size pairs, the
current code produces the wrong result in ~2100 cases. The new code
reduces that to 122 cases, all of which are off by one in the last
digit.

And I don't buy the symmetry argument either. Mathematically, it should
give the same, but your algorithm produces 2.04 MB for 512,4096 and 2.09
MB for 4096,512.

Maybe the commit message could be better, but I think it makes a lot of
sense to make blk_size u32. Breaking the symmetry between size and
blk_size is good (less likely that the arguments get swapped). It
allows a simpler implementation. It makes the generated code
smaller.

Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259099 — Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface

FromRasmus Villemoes <linux@rasmusvillemoes.dk>
Date2015-10-30 00:30 +0100
SubjectRe: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface
Message-ID<qp4NQ-6FS-17@gated-at.bofh.it>
In reply to#1259092
On Fri, Oct 30 2015, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:

> block sizes as well. For ~13000 semirandom size,blk_size pairs,

Sorry, that should have been ~20000.

Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259189 — Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface

FromJames Bottomley <jbottomley@odin.com>
Date2015-10-30 04:40 +0100
SubjectRe: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface
Message-ID<qp8HL-DT-5@gated-at.bofh.it>
In reply to#1259092
T24gRnJpLCAyMDE1LTEwLTMwIGF0IDAwOjE5ICswMTAwLCBSYXNtdXMgVmlsbGVtb2VzIHdyb3Rl
Og0KPiBPbiBUaHUsIE9jdCAyOSAyMDE1LCBKYW1lcyBCb3R0b21sZXkgPGpib3R0b21sZXlAb2Rp
bi5jb20+IHdyb3RlOg0KP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QpzaG9ydCBzaWdodGVkIGVub3VnaCB0byBjYXAgYmxvY2sgc2l6ZSB0byBhIHUzMi4NCg0KSmFt
ZXMNCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259390 — Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-10-30 11:50 +0100
SubjectRe: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface
Message-ID<qpfpU-4J3-25@gated-at.bofh.it>
In reply to#1259054
James Bottomley <jbottomley@odin.com> writes:

> On Thu, 2015-10-29 at 17:30 +0100, Vitaly Kuznetsov wrote:
>> string_get_size() can't really handle huge block sizes, especially
>> blk_size > U32_MAX but string_get_size() interface states the opposite.
>> Change blk_size from u64 to u32 to reflect the reality.
>
> What is the actual evidence for this?  The calculation is designed to be
> a symmetric 128 bit multiply.  When I wrote and tested it, it worked
> fine for huge block sizes.

We have 'u32 remainder' and then we do:

exp = divisor[units] / (u32)blk_size;
...
remainder = do_div(size, divisor[units]);
remainder *= blk_size;

I'm pretty sure it will overflow for some inputs.

>
> James
>
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>>  include/linux/string_helpers.h | 2 +-
>>  lib/string_helpers.c           | 4 ++--
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
>> index dabe643..1223e80 100644
>> --- a/include/linux/string_helpers.h
>> +++ b/include/linux/string_helpers.h
>> @@ -10,7 +10,7 @@ enum string_size_units {
>>  	STRING_UNITS_2,		/* use binary powers of 2^10 */
>>  };
>>  
>> -void string_get_size(u64 size, u64 blk_size, enum string_size_units units,
>> +void string_get_size(u64 size, u32 blk_size, enum string_size_units units,
>>  		     char *buf, int len);
>>  
>>  #define UNESCAPE_SPACE		0x01
>> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
>> index 5939f63..f6c27dc 100644
>> --- a/lib/string_helpers.c
>> +++ b/lib/string_helpers.c
>> @@ -26,7 +26,7 @@
>>   * at least 9 bytes and will always be zero terminated.
>>   *
>>   */
>> -void string_get_size(u64 size, u64 blk_size, const enum string_size_units units,
>> +void string_get_size(u64 size, u32 blk_size, const enum string_size_units units,
>>  		     char *buf, int len)
>>  {
>>  	static const char *const units_10[] = {
>> @@ -58,7 +58,7 @@ void string_get_size(u64 size, u64 blk_size, const enum string_size_units units,
>>  		i++;
>>  	}
>>  
>> -	exp = divisor[units] / (u32)blk_size;
>> +	exp = divisor[units] / blk_size;
>>  	/*
>>  	 * size must be strictly greater than exp here to ensure that remainder
>>  	 * is greater than divisor[units] coming out of the if below.

-- 
  Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259875 — Re: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface

FromJames Bottomley <jbottomley@odin.com>
Date2015-10-31 01:30 +0100
SubjectRe: [PATCH v3 1/4] lib/string_helpers: change blk_size to u32 for string_get_size() interface
Message-ID<qpsds-4eY-9@gated-at.bofh.it>
In reply to#1259390
T24gRnJpLCAyMDE1LTEwLTMwIGF0IDExOjQ2ICswMTAwLCBWaXRhbHkgS3V6bmV0c292IHdyb3Rl
Og0KPiBKYW1lcyBCb3R0b21sZXkgPGpib3R0b21sZXlAb2Rpbi5jb20+IHdyaXRlczoNCj4gDQo+
ID4gT24gVGh1LCAyMDE1LTEwLTI5IGF0IDE3OjMwICswMTAwLCBWaXRhbHkgS3V6bmV0c292IHdy
b3RlOg0KPiA+PiBzdHJpbmdfZ2V0X3NpemUoKSBjYW4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lmIGJlbG93Lg0KPiANCg0KDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1258911 — [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-10-29 17:40 +0100
Subject[PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0
Message-ID<qoYp4-2B4-21@gated-at.bofh.it>
In reply to#1258906
Division by zero happens if blk_size=0 is supplied to string_get_size().
Add WARN_ON() and set size to 0 to report '0 B'.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 lib/string_helpers.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/string_helpers.c b/lib/string_helpers.c
index f6c27dc..ff3575b 100644
--- a/lib/string_helpers.c
+++ b/lib/string_helpers.c
@@ -50,6 +50,11 @@ void string_get_size(u64 size, u32 blk_size, const enum string_size_units units,
 
 	tmp[0] = '\0';
 	i = 0;
+
+	/* Calling string_get_size() with blk_size=0 is wrong! */
+	if (WARN_ON(!blk_size))
+		size = 0;
+
 	if (!size)
 		goto out;
 
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259014 — Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2015-10-29 22:30 +0100
SubjectRe: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0
Message-ID<qp2VI-5uW-17@gated-at.bofh.it>
In reply to#1258911
On Thu, Oct 29, 2015 at 6:30 PM, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
> Division by zero happens if blk_size=0 is supplied to string_get_size().
> Add WARN_ON() and set size to 0 to report '0 B'.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> ---
>  lib/string_helpers.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
> index f6c27dc..ff3575b 100644
> --- a/lib/string_helpers.c
> +++ b/lib/string_helpers.c
> @@ -50,6 +50,11 @@ void string_get_size(u64 size, u32 blk_size, const enum string_size_units units,
>
>         tmp[0] = '\0';
>         i = 0;
> +
> +       /* Calling string_get_size() with blk_size=0 is wrong! */
> +       if (WARN_ON(!blk_size))
> +               size = 0;
> +
>         if (!size)
>                 goto out;
>
> --
> 2.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259091 — Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0

FromJames Bottomley <jbottomley@odin.com>
Date2015-10-30 00:10 +0100
SubjectRe: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0
Message-ID<qp4uu-6yv-29@gated-at.bofh.it>
In reply to#1258911
T24gVGh1LCAyMDE1LTEwLTI5IGF0IDE3OjMwICswMTAwLCBWaXRhbHkgS3V6bmV0c292IHdyb3Rl
Og0KPiBEaXZpc2lvbiBieSB6ZXJvIGhhcHBlbnMgaWYgYmxrX3NpemU9MCBpcyBzdXBwbGllZCB0
byBzdHJpbmdfZ2V0X3NpemUoK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Lg0KDQpKYW1lcw0KDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259104 — Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2015-10-30 00:40 +0100
SubjectRe: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0
Message-ID<qp4Xv-6IO-11@gated-at.bofh.it>
In reply to#1259091
On Fri, Oct 30, 2015 at 1:00 AM, James Bottomley <jbottomley@odin.com> wrote:
> On Thu, 2015-10-29 at 17:30 +0100, Vitaly Kuznetsov wrote:
>> Division by zero happens if blk_size=0 is supplied to string_get_size().
>> Add WARN_ON() and set size to 0 to report '0 B'.
>>
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>>  lib/string_helpers.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
>> index f6c27dc..ff3575b 100644
>> --- a/lib/string_helpers.c
>> +++ b/lib/string_helpers.c
>> @@ -50,6 +50,11 @@ void string_get_size(u64 size, u32 blk_size, const enum string_size_units units,
>>
>>       tmp[0] = '\0';
>>       i = 0;
>> +
>> +     /* Calling string_get_size() with blk_size=0 is wrong! */
>> +     if (WARN_ON(!blk_size))
>
> Get rid of the WARN_ON; it's the standard thing to do for a partially
> connected device.  Seeing zero is standard in a whole variety of
> situations.  SCSI shims the zero but most other drivers don't.

For *block* size? It will crash the kernel. I've checked, it wasn't
changed from the beginning (b9f28d863594).

+       exp = divisor[units] / (u32)blk_size;

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259188 — Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0

FromJames Bottomley <jbottomley@odin.com>
Date2015-10-30 04:40 +0100
SubjectRe: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0
Message-ID<qp8HL-DT-1@gated-at.bofh.it>
In reply to#1259104
T24gRnJpLCAyMDE1LTEwLTMwIGF0IDAxOjMyICswMjAwLCBBbmR5IFNoZXZjaGVua28gd3JvdGU6
DQo+IE9uIEZyaSwgT2N0IDMwLCAyMDE1IGF0IDE6MDAgQU0sIEphbWVzIEJvdHRvbWxleSA8amJv
dHRvbWxleUBvZGluLmNvbT4gd3JvdGU6DQo+ID4gT24gVGh1LCAyMDE1LTEwLTI5IGF0IDE3OjMw
ICswMTAwLCBWaXRhbHkgS3V6bmV0c292IHdyb3RlOg0KPiA+PiBEaXZpc2lvbiBieSB6ZXJvIGhh
cHBlbnMgaWYgYmxrX3NpemU9MCBpcyBzdXBwbGllZCB0byBzdHJpbmdfZ2V0X3NpemUoKS4NCj4g
Pj4gQWRkIFdBUk5fT04oKSBhbmQgc2V0IHNpemUgdG8gMCB0byByZXBvcnQgJzAgQicuDQo+ID4+
DQo+ID4+IFNpZ25lZC1vZmYtYnk6IFZpdGFseSBLdXpuZXRzb3YgPHZrdXpuZXRzQHJlZGhhdC5j
b20+DQo+ID4+IC0tLQ0KPiA+PiAgbGliL3N0cmluZ19oZWxwZXJzLmMgfCA1ICsrKysrDQo+ID4+
ICAxIGZpbGUgY2hhbmdlZCwgNSBpbnNlcnRpb25zKCspDQo+ID4+DQo+ID4+IGRpZmYgLS1naXQg
YS9saWIvc3RyaW5nX2hlbHBlcnMuYyBiL2xpYi9zdHJpbmdfaGVscGVycy5jDQo+ID4+IGluZGV4
IGY2YzI3ZGMuLmZmMzU3NWIgMTAwNjQ0DQo+ID4+IC0tLSBhL2xpYi9zdHJpbmdfaGVscGVycy5j
DQo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CnNjYXJ5IHdh
cm5pbmdzLg0KDQpKYW1lcw0KDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259392 — Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-10-30 11:50 +0100
SubjectRe: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0
Message-ID<qpfpU-4J3-31@gated-at.bofh.it>
In reply to#1259188
James Bottomley <jbottomley@odin.com> writes:

> On Fri, 2015-10-30 at 01:32 +0200, Andy Shevchenko wrote:
>> On Fri, Oct 30, 2015 at 1:00 AM, James Bottomley <jbottomley@odin.com> wrote:
>> > On Thu, 2015-10-29 at 17:30 +0100, Vitaly Kuznetsov wrote:
>> >> Division by zero happens if blk_size=0 is supplied to string_get_size().
>> >> Add WARN_ON() and set size to 0 to report '0 B'.
>> >>
>> >> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> >> ---
>> >>  lib/string_helpers.c | 5 +++++
>> >>  1 file changed, 5 insertions(+)
>> >>
>> >> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
>> >> index f6c27dc..ff3575b 100644
>> >> --- a/lib/string_helpers.c
>> >> +++ b/lib/string_helpers.c
>> >> @@ -50,6 +50,11 @@ void string_get_size(u64 size, u32 blk_size, const enum string_size_units units,
>> >>
>> >>       tmp[0] = '\0';
>> >>       i = 0;
>> >> +
>> >> +     /* Calling string_get_size() with blk_size=0 is wrong! */
>> >> +     if (WARN_ON(!blk_size))
>> >
>> > Get rid of the WARN_ON; it's the standard thing to do for a partially
>> > connected device.  Seeing zero is standard in a whole variety of
>> > situations.  SCSI shims the zero but most other drivers don't.
>> 
>> For *block* size? It will crash the kernel. I've checked, it wasn't
>> changed from the beginning (b9f28d863594).
>
> The standard signal for a drive error in capacity is zero size and zero
> block size.  We have to take that case as standard without emitting
> scary warnings.

Ok, but what if size != 0? Is WARN_ON() justified in this case?

-- 
  Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259870 — Re: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0

FromJames Bottomley <jbottomley@odin.com>
Date2015-10-31 01:10 +0100
SubjectRe: [PATCH v3 2/4] lib/string_helpers.c: protect string_get_size() against blk_size=0
Message-ID<qprU5-482-7@gated-at.bofh.it>
In reply to#1259392
T24gRnJpLCAyMDE1LTEwLTMwIGF0IDExOjQxICswMTAwLCBWaXRhbHkgS3V6bmV0c292IHdyb3Rl
Og0KPiBKYW1lcyBCb3R0b21sZXkgPGpib3R0b21sZXlAb2Rpbi5jb20+IHdyaXRlczoNCj4gDQo+
ID4gT24gRnJpLCAyMDE1LTEwLTMwIGF0IDAxOjMyICswMjAwLCBBbmR5IFNoZXZjaGVua28gd3Jv
dGU6DQo+ID4+IE9uIEZyaSwgT2N0IDMwLCAyMDE1IGF0IDE6MDAgQU0sIEphbWVzIEJvdHRvbWxl
eSA8amJvdHRvbWxleUBvZGluLmNvbT4gd3JvdGU6DQo+ID4+ID4gT24gVGh1LCAyMDE1LTEwLTI5
IGF0IDE3OjMwICswMTAwLCBWaXRhbHkgS3V6bmV0c292IHdyb3RlOg0KPiA+PiA+PiBEaXZpc2lv
biBieSB6ZXJvIGhhcHBlbnMgaWYgYmxrX3NpemU9MCBpcyBzdXBwbGllZCB0byBzdHJpbmdfZ2V0
X3NpemUoKS4NCj4gPj4gPj4gQWRkIFdBUk5fT04oKSBhbmQgc2V0IHNpemUgdG8gMCB0byByZXBv
cnQgJzAgQicuDQo+ID4+ID4+DQo+ID4+ID4+IFNpZ25lZC1vZmY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HdoaWNoIGZvciB0d28gc2l4dHkNCmZvdXIgYml0IG51bWJlcnMgbXVsdGlwbHlpbmcgdG8g
YSAxMjggYml0IG9uZSBpcyBuZXZlcikuDQoNCkphbWVzDQoNCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web