bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] gnu tar: Sparse Bug


From: Andrew Somerville
Subject: [Bug-tar] gnu tar: Sparse Bug
Date: Thu, 21 Aug 2003 09:38:28 -0400

I have come up with modifications that correct the problem. However, the changes increase the extraction time significantly for sparse files. Its possible that there may be a more efficent way to implement a fix, but since the fix requires a write instead of an lseek, increase in extraction time is necessarily a consequence.

        Im not sure if the fix should be standard, or only used with the "--block-dev-contents" flag, because Im unaware if this probelem could show up an another case. It comes to my mind that the bug could show up when overwriting files already in place. In this case if there was a sparse section where there previously was not, the previous data would show up in the new file in places where it should be sparse. However, that would only happen in cases of overwriting, and only if the old file was not deleted before writing the new one. I dont know how tar handles overwriting, so this issue should be investigated further. I dont have the time or motivation to test this right now, so unless you have information indicating otherwise, the patch I submit will use the new code on a condition of the "--block-dev-contents" flag.

        One final consideration is whether the way I made the modification is appropriate to gnu standard. To write the zeros efficiently, I set up an GLOBAL (extern) var in common.h, which was a unsigned char pointer, then connected it to an array which i filled with zeros (of size BLOCKSIZE) in the beginning of main in tar.c, then used that to write blocksize (or less) chunks of zero data, with full_write. Let me know if this is acceptable, so that I can make sure that any patch I submit does not get rejected on that basis.

        Regards,
        Andrew Somerville


  


reply via email to

[Prev in Thread] Current Thread [Next in Thread]