summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-07-16 01:47:52 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-07-16 01:48:32 -0400
commit20ae9b49848ceb416966fbfddbab9bb403cf2678 (patch)
tree3df9439434d878515c0488d3a7fb4239a9dc0d7c
parentf6b4e6b11e12b4395587b3918ca2d6c385beeb94 (diff)
bcachefs: Fix __bch2_strtoh
when looking up the unit, it was matching against the trailing null in si_units Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c
index 24c6cc568762..1272ea7a7a28 100644
--- a/fs/bcachefs/util.c
+++ b/fs/bcachefs/util.c
@@ -52,7 +52,7 @@ static int __bch2_strtoh(const char *cp, u64 *res,
cp++;
} while (isdigit(*cp));
- for (u = 1; u < ARRAY_SIZE(si_units); u++)
+ for (u = 1; u < strlen(si_units); u++)
if (*cp == si_units[u]) {
cp++;
goto got_unit;