bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] infinite loop in sparse_dump_region()


From: François Ouellet
Subject: [Bug-tar] infinite loop in sparse_dump_region()
Date: Thu, 13 Mar 2014 14:43:55 -0400
User-agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; )

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:

    --- sparse.c.orig       2014-02-28 10:54:13.000000000 -0500
    +++ sparse.c    2014-02-28 10:53:51.000000000 -0500
    @@ -312,7 +312,7 @@

           blk = find_next_block ();
           bytes_read = safe_read (file->fd, blk->buffer, bufsize);
    -      if (bytes_read == SAFE_READ_ERROR)
    +      if (bytes_read == SAFE_READ_ERROR || bytes_read == 0)
            {
               read_diag_details (file->stat_info->orig_file_name,
                                 (file->stat_info->sparse_map[i].offset

It now gives a false error message:

  tar.debug: ./backupad.pst: Warning: Read error at byte 5412242432, while 
reading 512 bytes

but doesn't hang anymore.

PS
We do not backup the file while it is being updated, but amanda runs
its estimation phase on a live filesystem.



reply via email to

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