Re: [PATCH 7/5] fsck: use streaming interface for large blobs in pack

2016-07-12 Thread Junio C Hamano
Junio C Hamano writes: >> +if (type != OBJ_BLOB || size < big_file_threshold) { >> +data = unpack_entry(p, entries[i].offset, , ); >> +data_valid = 1; > > This codepath slurps the data in-core to hash and data is later >

Re: [PATCH 7/5] fsck: use streaming interface for large blobs in pack

2016-07-12 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > For this particular operation, not unpacking the blob and letting > check_sha1_signature, which supports streaming interface, do the job > is sufficient. That reasoning is sound, I would think, but... > We will call the callback function "fn"

[PATCH 7/5] fsck: use streaming interface for large blobs in pack

2016-07-10 Thread Nguyễn Thái Ngọc Duy
For blobs, we want to make sure the on-disk data is not corrupted (i.e. can be inflated and produce the expected SHA-1). Blob content is opaque, there's nothing else inside to check for. For really large blobs, we may want to avoid unpacking the entire blob in memory, just to check whether it