Re: libDAR skips files above 3 KB - Please help
Denis Corbin <[email protected]> Mon, 28 Apr 2008 10:53:40 +0200
| Newsgroups | gmane.comp.sysutils.backup.dar.libdar |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Satheesh wrote:
> Denis Corbin <dar.linux@...> writes:
[...]
>>
>>> ::read is failing for files above ~3.2 K only.
>> If ::read is failing, this has for consequence to make
>> fichier::inherited_read to fail also. The question is thus why ::read
>> fails? Maybe one argument is out of range? I wonder in particular if the
>> amount of data read at once is not exceeding the system's capabilities.
>>
>> As you can read at the top of src/libdar/generic_file.cpp, this amount
>> is 10 kbytes unless this value is over the value given by the SSIZE_MAX
>> system macro (if it exists), in which case it takes this value.
>>
> I noted that value as 100 K (102400).
>
>> Does your system defines such a macro? Can you try a simple C (or C++)
>> program with smaller values (a few bytes for example) on a large file.
>>
> My system defines that macro - it gave a really large value 2147483647.
> Obviously, it was taking 102400. So I modified it to 10240 and it all started
> working. Thanks a lot.
>
>>> I verified the same use-case on
>>> RH Linux EL4 on x86 where this problem do not happen. I am using libdar
>>> version 2.3.6.
>> Yep, this only shows that the problem is either internal to the system
>> or that dar is not adapted to that system.
>>
>
> I forgot to mention another problem that I encountered early on with stat
> call. Line 535 of sar.cpp (if(stat(fic, &buf) < 0)). "stat" is always failing
> with an errno not equal to ENOINT. Error code:0. Since my target location
> changes each time I run a backup, I've commented that if-else block and always
> creating a new file. Can you comment on why stat fails ?
first it would be interesting to know which value is returned by the
stat() system call. I suggest replacing
if(stat(fic, &buf) < 0)
{
[...]
}
by
int retval = stat(fic, &buf);
if(retval < 0)
{
[...]
}
then using gdb put a break point on that statement and get the value of
retval once stat has returned. If you are not used to gdb, then you can
just print out the retval value using the following statement for
example (for debugging purpose only, of course):
cout << "RETVAL is " << retval << endl;
Then we would need the man page about the stat system call ('man 2 stat'
or 'man 3 stat' depending on your system) and also access to the system
header files where are defined the ENOENT ENOTDIR EBADF and other macros.
This is what I would do if I had access to such a system to understand
why this operating system fails returning the information whether the
file exists or not.
But this problem is not linked to the previous one you described about
large files. It is still interesting to determin if SSIZE_MAX is defined
or if your system uses non POSIX macro to define the maximum amount of
data a process can read at once from file.
> It's attempting to
> check for a file "/data/backup/042608/full.1.dar", where the
> directory "/data/backup/042608" exists with all permissions.
Yep, but the stat system call should either return ENOENT if the file
full.1.dar does not exist under that directory or return 0 if it exist
and provide a struct stat data structure about that existing file. You
just need read access to that /data/backup/042608 directory.
>
>>> Regards,
>>> Satheesh
>>>
>>>
>> Regards,
>> Denis.
>>
>>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIFZCUpC5CI8gYGlIRAsdUAJ9MVl1tJvKqN0ND9ZW6gvNQkSuOVwCgjwBh
zBnC1kHda2M66VEveFSfiY8=
=gEk/
-----END PGP SIGNATURE-----
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone