bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] infinite loop in sparse_dump_region()


From: Pavel Raiskup
Subject: Re: [Bug-tar] infinite loop in sparse_dump_region()
Date: Sun, 16 Mar 2014 22:55:38 +0100
User-agent: KMail/4.12.3 (Linux/3.13.6-200.fc20.x86_64; KDE/4.12.3; x86_64; ; )

Hello François,

On Thursday, March 13, 2014 14:43:55 François Ouellet wrote:
> When dumping a file which is being actively updated by an application
> (in our case it was an outlook pst file on our samba server), safe_read()
> can sometimes return 0.
> 
> When it happens, sparse_dump_region() goes into an infinite loop.
> 
> I don't know what the proper fix would be.  I just fixed it on our server
> with this:

thanks for clear report!  You can try the attached patch if you wanted (but it
has the same effects as yours one, just the message is little bit different).
Reproducer:

  $ truncate -s 10M file
  $ tar cSf archive file
  $ truncate -s 5M file
  $ tar df archive

Could we please apply at least something like the patch attached?
Looking at the code, I don't like duplications.  I was thinking
about safe_read/blocking_read wrapper with sth. like 'bool may_eof'
argument (and others) to make it possible to deal with errors at one
place (stopped once I realized that it will be somehow bigger code
change).  Would you be interested in such patch?

Pavel

Attachment: 0001-tar-fix-infinite-loop-in-diff-for-sparse-files.patch
Description: Text Data


reply via email to

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