[CentOS] Preventing the nightly backup from disturbing the cache

Mon Apr 24 22:16:21 UTC 2006
David Mansfield <centos at dm.cobite.com>


Steve Bergman wrote:
> Andy Green wrote:
> 
>> Adam Gibson wrote:
>>
>>
>> It's possible to use the flag
>>
>> O_DIRECT
>>
> 
> Thanks.  :-)
> 
> 
> --- src/create.c.orig   2006-04-24 15:39:00.000000000 -0500
> +++ src/create.c        2006-04-24 16:28:13.000000000 -0500
> @@ -1373,7 +1373,7 @@
>          if (file_dumpable_p (st))
>            {
>              fd = open (st->orig_file_name,
> -                        O_RDONLY | O_BINARY);
> +                        O_RDONLY | O_BINARY | O_DIRECT);
>              if (fd < 0)
>                {
>                  if (!top_level && errno == ENOENT)
> 

I don't think this is necessarily safe to do.  O_DIRECT adds additional 
requirements to the memory buffer's alignment and file position 
alignments.  Unless you have audited the 'tar' source code, I think this 
is a bad idea.

David