Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2436)

Issue 110480043: code review 110480043: archive/tar: fix writing of pax headers (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 10 months ago by unclejack
Modified:
9 years, 7 months ago
Reviewers:
gobot, dsymonds
CC:
dsymonds, dave_cheney.net, iant, golang-codereviews
Visibility:
Public.

Description

archive/tar: fix writing of pax headers "archive/tar: reuse temporary buffer in writeHeader" introduced a change which was supposed to help lower the number of allocations from 512 bytes for every call to writeHeader. This change broke the writing of PAX headers. writeHeader calls writePAXHeader and writePAXHeader calls writeHeader again. writeHeader will end up writing the PAX header twice. example broken header: PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000 PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000 example correct header: PaxHeaders.4290/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021516 xustar0000000000000000 0100644000000000000000000000270412301216634007250 0ustar0000000000000000 This commit adds a dedicated buffer for pax headers to the Writer struct. This change increases the size of the struct by 512 bytes, but allows tar/writer to avoid allocating 512 bytes for all written headers and it avoids allocating 512 more bytes for pax headers.

Patch Set 1 #

Patch Set 2 : diff -r fca86a5afe65 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 36cc211b26b4 https://code.google.com/p/go/ #

Patch Set 4 : diff -r 36cc211b26b4 https://code.google.com/p/go/ #

Total comments: 4

Patch Set 5 : diff -r 36cc211b26b4 https://code.google.com/p/go/ #

Total comments: 6

Patch Set 6 : diff -r 395bf97d72a1 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -2 lines) Patch
M src/pkg/archive/tar/writer.go View 1 2 3 4 5 2 chunks +13 lines, -2 lines 0 comments Download
M src/pkg/archive/tar/writer_test.go View 1 2 3 4 5 1 chunk +35 lines, -0 lines 0 comments Download

Messages

Total messages: 15
unclejack
Hello, This CL fixes a problem introduced by a CL I've sent before. Unfortunately, this ...
9 years, 10 months ago (2014-07-10 15:07:17 UTC) #1
iant
Is it possible to write a test for this?
9 years, 10 months ago (2014-07-10 15:42:30 UTC) #2
unclejack
I'll look into it. You'll receive another notification when I've added a test. On 2014/07/10 ...
9 years, 10 months ago (2014-07-10 15:50:41 UTC) #3
unclejack
You'll find a test in the latest patch set. This test checks if the Typeflag ...
9 years, 10 months ago (2014-07-11 20:08:44 UTC) #4
unclejack
Hello dsymonds@golang.org, dave@cheney.net, iant@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
9 years, 10 months ago (2014-07-12 08:47:52 UTC) #5
dsymonds
https://codereview.appspot.com/110480043/diff/80001/src/pkg/archive/tar/writer.go File src/pkg/archive/tar/writer.go (right): https://codereview.appspot.com/110480043/diff/80001/src/pkg/archive/tar/writer.go#newcode169 src/pkg/archive/tar/writer.go:169: header = tw.paxHdrBuff[:] this looks backwards; if PAX is ...
9 years, 10 months ago (2014-07-13 23:30:41 UTC) #6
unclejack
I've updated the patch. You'll find some new comments in the revised patch. These should ...
9 years, 10 months ago (2014-07-14 14:25:52 UTC) #7
unclejack
Hello, Is there anything I could do to help with the review of this CL?
9 years, 10 months ago (2014-07-15 21:22:32 UTC) #8
dsymonds
On 16 July 2014 07:22, <unclejacksons@gmail.com> wrote: > Is there anything I could do to ...
9 years, 10 months ago (2014-07-15 23:25:16 UTC) #9
dsymonds
https://codereview.appspot.com/110480043/diff/120001/src/pkg/archive/tar/writer.go File src/pkg/archive/tar/writer.go (right): https://codereview.appspot.com/110480043/diff/120001/src/pkg/archive/tar/writer.go#newcode167 src/pkg/archive/tar/writer.go:167: // use paxHdrBuff when writing PAX headers to avoid ...
9 years, 10 months ago (2014-07-16 01:54:43 UTC) #10
unclejack
https://codereview.appspot.com/110480043/diff/120001/src/pkg/archive/tar/writer.go File src/pkg/archive/tar/writer.go (right): https://codereview.appspot.com/110480043/diff/120001/src/pkg/archive/tar/writer.go#newcode167 src/pkg/archive/tar/writer.go:167: // use paxHdrBuff when writing PAX headers to avoid ...
9 years, 10 months ago (2014-07-16 08:12:47 UTC) #11
dsymonds
LGTM I'll submit this tomorrow if no-one raises any objections. Thanks for doing this.
9 years, 10 months ago (2014-07-16 08:49:28 UTC) #12
dsymonds
*** Submitted as https://code.google.com/p/go/source/detail?r=1b17b3426e3c *** archive/tar: fix writing of pax headers "archive/tar: reuse temporary buffer ...
9 years, 10 months ago (2014-07-17 00:00:41 UTC) #13
gobot
This CL appears to have broken the plan9-386-cnielsen builder. See http://build.golang.org/log/881aabe9a7d0879310a5cc4f26eade3f1c396041
9 years, 10 months ago (2014-07-17 02:03:58 UTC) #14
unclejack
9 years, 7 months ago (2014-10-01 15:53:34 UTC) #15
*** Abandoned ***
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b