Commit 965bd8b9 authored by Chris Rorvick's avatar Chris Rorvick Committed by Greg Kroah-Hartman

drivers: staging: lustre: Use mult if units not specified

Units can be passed to lprocfs_write_frac_u64_helper() via a suffix
(e.g., "...K", "...M", etc.) tacked onto the value.  A comment states
that "specified units override the multiplier," though the multiplier is
overridden regardless.  Update the conditional logic so that it only
applies when units are specified.
Signed-off-by: default avatarChris Rorvick <chris@rorvick.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 054cd837
......@@ -1908,7 +1908,7 @@ int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
units <<= 10;
}
/* Specified units override the multiplier */
if (units)
if (units > 1)
mult = mult < 0 ? -units : units;
frac *= mult;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment