Number truncation with 4+ GB files on 32-bit systems
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest7 patches 1 replyIn review
- v15 patches 21 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | pack-objects: pass length to check_pack_crc() without truncationbuiltin/ sha1_file.c | +2 | 0 replies | |
| 2/7 | sha1_file.c: use type off_t* for object_info->disk_sizepbuiltin/ cache.h | +3 | 0 replies | |
| 3/7 | index-pack: correct "len" type in unpack_data()builtin/ | +7 | 0 replies | |
| 4/7 | index-pack: report correct bad object offsets even if they are largebuiltin/ | +4 | 0 replies | |
| 5/7 | index-pack: correct "offset" type in unpack_entry_data()builtin/ | +1 | 0 replies | |
| 6/7 | pack-objects: do not truncate result in-pack object size on 32-bit systemsbuiltin/ | +8 | 0 replies | |
| 7/7 | fsck: use streaming interface for large blobs in packbuiltin/ pack-check.c pack.h +1 more | +29 | 0 replies |
Reviews trailers per patch
None of the 7 patches has a Reviewed-by or Acked-by.
| Patch | Christoph Michelbach |
|---|---|
| 1/7 | Noticed-by |
| 2/7 | |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/7] Number truncation with 4+ GB files on 32-bit systems
A diff from nd/pack-ofs-4gb-limit can explain the changes better than me.
I did not add PRIdMAX or similar because that carries a risk to exotic platforms that people rarely test. Just casting to unsigned should be fine.
builtin/fsck.c +4 -0
@@ -356,6 +356,10 @@ static int fsck_sha1(const unsigned char *sha1)static int fsck_obj_buffer (const unsigned char *sha1,enum object_type type,unsigned long size,void *buffer,int *eaten) { +/* +* Note, buffer may be NULL if type is OBJ_BLOB. See +* verify_packfile(), data_valid variable for details. +*/ struct object *obj; obj =parse_object_buffer (sha1, type, size, buffer, eaten);if (!obj) {
pack-check.c +2 -1
@@ -106,7 +106,7 @@ static int verify_packfile(struct packed_git *p,enum object_type type;unsigned long size;off_t curpos; -int data_valid =0 ; +int data_valid;if (p->index_version >1 ) {off_t offset = entries[i].offset;
@@ -130,6 +130,7 @@ static int verify_packfile(struct packed_git *p,* the data in-core only to discard. */ data =NULL ; + data_valid =0 ; }else { data =unpack_entry (p, entries[i].offset, &type, &size); data_valid =1 ;
t/t1050-large.sh +3 -4
@@ -177,10 +177,9 @@ test_expect_success 'zip achiving, deflate' ' git archive --format=zip HEAD >/dev/null ' -test_expect_success 'fsck' ' - test_must_fail git fsck 2>err && - n=$(grep "error: attempting to allocate .* over limit" err | wc -l) && - test "$n" -gt 1 +test_expect_success 'fsck large blobs' ' + git fsck 2>err && + test_must_be_empty err ' test_done
Nguyễn Thái Ngọc Duy (7):
pack-objects: pass length to check_pack_crc() without truncation sha1_file.c: use type off_t* for object_info->disk_sizep
index-pack: correct "len" type in unpack_data()
index-pack: report correct bad object offsets even if they are large
index-pack: correct "offset" type in unpack_entry_data()
pack-objects: do not truncate result in-pack object size on 32-bit systems
fsck: use streaming interface for large blobs in pack
builtin/cat-file.c | 4 ++-- builtin/fsck.c | 4 ++++ builtin/index-pack.c | 23 ++++++++++++----------- builtin/pack-objects.c | 17 +++++++++-------- cache.h | 2 +- pack-check.c | 23 +++++++++++++++++++++-- pack.h | 1 + sha1_file.c | 2 +- t/t1050-large.sh | 7 +++---- 9 files changed, 54 insertions(+), 29 deletions(-)
Signature · 1 line
2.9.1.564.gb2f7278