diff --git a/metadata.cc b/metadata.cc index d473c17..a7da4b9 100644 --- a/metadata.cc +++ b/metadata.cc @@ -65,7 +65,7 @@ namespace { if (r) throw runtime_error("Couldn't stat dev path"); - if (S_ISREG(info.st_mode)) + if (S_ISREG(info.st_mode) && info.st_size) nr_blocks = div_up(info.st_size, MD_BLOCK_SIZE); else if (S_ISBLK(info.st_mode)) {