[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1445867720-25473-1-git-send-email-vkuznets@redhat.com>
Date: Mon, 26 Oct 2015 14:55:17 +0100
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
James Bottomley <JBottomley@...n.com>,
Kees Cook <keescook@...omium.org>, linux-kernel@...r.kernel.org
Subject: [PATCH 0/3] lib/string_helpers: fix precision issues and introduce tests
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/3 is a preparatory change, PATCH 2/3 re-factors string_get_size() fixing
the issue, PATCH 3/3 introduces tests for string_get_size().
PATCH 3/3 was previously sent as part of "lib/string_helpers.c: fix infinite
loop in string_get_size()" series but afaics wasn't merged. In this submission
I add additional tests to it.
Vitaly Kuznetsov (3):
lib/string_helpers: change blk_size to u32 for string_get_size()
interface
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 | 48 +++++++++++++++++++++++-------------------
lib/test-string_helpers.c | 44 ++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 23 deletions(-)
--
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists