depot/patches/base/s3ql/0001-fix-plain-block-size.patch

27 lines
1 KiB
Diff
Raw Normal View History

diff --git a/src/s3ql/backends/comprenc.py b/src/s3ql/backends/comprenc.py
index 6402fec1..9ed3627e 100644
--- a/src/s3ql/backends/comprenc.py
+++ b/src/s3ql/backends/comprenc.py
@@ -276,7 +276,7 @@ class ComprencBackend(AbstractBackend):
buf.seek(0)
fh = buf
- return self.backend.write_fh(key, fh, meta_raw)
+ return self.backend.write_fh(key, fh, meta_raw, len_=len_ if meta_raw['compression'] == 'None'and meta_raw['encryption'] == 'None' else None)
def contains(self, key):
return self.backend.contains(key)
diff --git a/src/s3ql/database.py b/src/s3ql/database.py
index bb4054e6..c2142bf6 100644
--- a/src/s3ql/database.py
+++ b/src/s3ql/database.py
@@ -659,7 +659,7 @@ def upload_metadata(
)
obj = METADATA_OBJ_NAME % (blockno, params.seq_no)
fh.seek(blockno * blocksize)
- backend.write_fh(obj, fh, len_=blocksize)
+ backend.write_fh(obj, fh, len_=min(blocksize, db_size - blockno * blocksize))
if not update_params:
return