Explorar o código

Merge pull request #2170 from ThomasWaldmann/fuse-integer-blocks

fuse: fix st_blocks to be an integer (not float) value
enkore %!s(int64=8) %!d(string=hai) anos
pai
achega
17537be13c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      borg/fuse.py

+ 1 - 1
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'])