Sfoglia il codice sorgente

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

fuse: fix st_blocks to be an integer (not float) value
enkore 8 anni fa
parent
commit
17537be13c
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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'])