Closed bioothod closed 8 years ago
Can you describe the reason for continuity of writing blocks?
Contiguous blocks overwrite file as a whole object in this case, i.e. going to replace it, not just overwrite some pieces of it (for example starting from some offset), thus it is safe to allow this. It would not be the case for common write, but plain write started from the beginning is a sign of replacement, otherwise we would use common write with offset.
I would actually remove that check at all.
If we call prepare
then we are about to replace the whole file, then it is safe to overwrite old data which doesn't have external header
Check removed, this commit allows plain write to overwrite old or broken records (without BLOB_DISK_CTL_EXTHDR flag), since prepare+plain_write is not used for partial update, prepare by itself a sign, that we are writing a new record and reserve space for it.
Invalid approach, eblob_write_prepare()
should fix flags instead
Allow to overwrite old or broken keys (without BLOB_DISK_CTL_EXTHDR flag) with contiguous blocks