I'm using the -A patch on v2.6.2, and I'm doing the usual "incremental 
backup using links" 
thing.ÂÂTheÂdestinationÂisÂaÂmachineÂrunningÂFedoraÂ
(both 2 and 3), and the sources are machines running various Linuxes and 
Solaris.

During my initial testing, I found a lot of diskspace being wasted.ÂÂIÂ
traced this back to files being copied when a link would suffice.ÂÂIÂfoundÂ
that this was caused by a difference between how Solaris and Linux returned 
a file's mode from stat() when ACLs are in use.

Looking further into this, I also found that rsync would not copy a file 
(even between two Linux machines) if the ACLs had changed; it would leave
the link in place.

In other words, ACLs weren't being properly considered when determining 
whether to link or copy a file.

I built into my version a 
fix.ÂÂHasÂthisÂalreadyÂbeenÂfixedÂinÂ2.6.3ÂorÂtheÂ
upcoming .4, or is someone interested in what I did?

What I did was pretty simple.ÂÂToÂacls.cÂIÂaddedÂaÂfunctionÂ
test_if_acls_match().ÂÂIÂthenÂmodifiedÂskip_file()ÂinÂgenerator.cÂtoÂuseÂ
this, instead of stat()'s modes, if both link_dest and preserve_acls are 
set.ÂÂ

This solves both of the above 
problems.ÂÂTheÂdifferencesÂinÂstat()'sÂreturnÂ
of modes between Linux and Solaris is avoided because skip_file() isn't 
looking at the modes of the old and new files; it's looking at the ACLs.ÂÂ
And because it is looking at the ACLs, it'll see that a copy is needed if 
there's been an ACL change but no other change.

None of what I did is especially 
complex.ÂÂButÂifÂthisÂhasn'tÂyetÂbeenÂfixedÂ
in the repository, and if someone wants to see what I've done, I'm happy to 
send 
it.ÂÂThisÂwasÂmyÂfirstÂpeekÂatÂtheÂrsyncÂcode,Âthough,ÂsoÂIÂprovideÂnoÂ
guarantee that this is the best way of achieving the fix.ÂÂNorÂdidÂIÂ
consider the case of using --delete instead of --link-dest, or using
neither.

ÂÂÂÂÂÂÂÂ-ÂAndrew

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to