The number of blocks calculated from a percent value given to the
-min-reclaimable-blocks command line parameter of nilfs-clean is rounded
up. The same percent value in the configuration file is not rounded up.
This patch fixes the inconsistency by rounding up both values.

Signed-off-by: Andreas Rohner <[email protected]>
---
 sbin/cleanerd/cldconfig.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sbin/cleanerd/cldconfig.c b/sbin/cleanerd/cldconfig.c
index bdd8c85..c8b197b 100644
--- a/sbin/cleanerd/cldconfig.c
+++ b/sbin/cleanerd/cldconfig.c
@@ -472,7 +472,8 @@ nilfs_convert_size_to_blocks_per_segment(struct nilfs 
*nilfs,
        if (param->unit == NILFS_SIZE_UNIT_NONE) {
                ret = param->num;
        } else if (param->unit == NILFS_SIZE_UNIT_PERCENT) {
-               ret = (nilfs_get_blocks_per_segment(nilfs) * param->num) / 100;
+               ret = (nilfs_get_blocks_per_segment(nilfs) * param->num + 99)
+                               / 100;
        } else {
                block_size = nilfs_get_block_size(nilfs);
                segment_size = block_size *
-- 
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to