From 81d3a4eb227f8fafbf81a1b85f0a32b58b279fd4 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 16 Feb 2017 23:55:27 +0100 Subject: [PATCH] fuse: fix st_blocks to be an integer (not float) value it's basically ceil(dsize / blocksize) now (without doing floating point ops). --- borg/fuse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/borg/fuse.py b/borg/fuse.py index 7a59ddc16..67a7a94af 100644 --- a/borg/fuse.py +++ b/borg/fuse.py @@ -214,7 +214,7 @@ class FuseOperations(llfuse.Operations): entry.st_rdev = item.get(b'rdev', 0) entry.st_size = size entry.st_blksize = 512 - entry.st_blocks = dsize / 512 + entry.st_blocks = (dsize + entry.st_blksize - 1) // entry.st_blksize # note: older archives only have mtime (not atime nor ctime) if have_fuse_xtime_ns: entry.st_mtime_ns = bigint_to_int(item[b'mtime'])