From ba6984504e8ccc120335e722a6f04bfaace47f2d Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Tue, 13 Mar 2012 12:15:32 +0100 Subject: [PATCH] Fix segfault with file argument --- metadata.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.cc b/metadata.cc index 8de2974..d473c17 100644 --- a/metadata.cc +++ b/metadata.cc @@ -66,7 +66,7 @@ namespace { throw runtime_error("Couldn't stat dev path"); if (S_ISREG(info.st_mode)) - nr_blocks = div_down(info.st_size, MD_BLOCK_SIZE); + nr_blocks = div_up(info.st_size, MD_BLOCK_SIZE); else if (S_ISBLK(info.st_mode)) { // To get the size of a block device we need to