https://bugzilla.samba.org/show_bug.cgi?id=2933 wayned@samba.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Additional Comments From wayned@samba.org 2005-07-31 15:50 ------- This is rather interesting. In the old days, rsync didn't hard-link symlinks and devices. In 2.6.1 through 2.6.3, hard-linked non-regular files began to be supported, but in a way that was inefficient (the symlinks and devices would all get created as separate entities, and then the post-processing hard-link pass would hard-link any groups together, possibly deleting a symlink or device that was just created. In 2.6.4, the post-processing pass was done away with (to make things more efficient), and thus the hard-linking of these non-regular files broke. So, the fix is to add hard-linking code to symlinks and devices so that they get handled properly from the start. I'll attach a patch that does this. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=2933 ------- Additional Comments From wayned@samba.org 2005-07-31 16:20 ------- Created an attachment (id=1344) --> (https://bugzilla.samba.org/attachment.cgi?id=1344&action=view) Make hard-linking work with symlinks and devices The attached patch was just checked into CVS. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=2933 wayned@samba.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Additional Comments From wayned@samba.org 2005-07-31 16:22 ------- This should be fixed in the CVS version. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=2933 ------- Additional Comments From noreply@cpe-24-95-90-2.columbus.res.rr.com 2005-07-31 17:01 ------- added a fuller test case... note freebsd link(2) currently doesn't hardlink symlinks or directories. there's also something called whiteout. all conceivably link(2)able but moot at the moment. so this would apply to all other types excluding regular files. ls -liT srcdir 240854 lrwxrwx--- 1 root wheel 1 Jul 31 05:07:23 2005 a -> b 240848 -rw-r----- 1 root wheel 0 Jul 31 05:07:23 2005 b 240860 prw-rw---- 1 root wheel 0 Jul 31 19:06:16 2005 fifo0 242281 prw-rw---- 2 root wheel 0 Jul 31 19:04:09 2005 fifohard1 242281 prw-rw---- 2 root wheel 0 Jul 31 19:04:09 2005 fifohard2 240853 -rw-rw---- 1 root wheel 0 Jul 31 19:06:16 2005 file0 240852 -rw-rw---- 2 root wheel 0 Jul 31 00:58:38 2005 filehard1 240852 -rw-rw---- 2 root wheel 0 Jul 31 00:58:38 2005 filehard2 242266 crw-rw---- 1 root wheel 2, 2 Jul 31 19:06:16 2005 null0 242484 crw-rw---- 2 root wheel 2, 2 Jul 31 19:05:55 2005 nullhard1 242484 crw-rw---- 2 root wheel 2, 2 Jul 31 19:05:55 2005 nullhard2 240846 srwxrwx--- 1 root wheel 0 Jul 31 19:06:16 2005 socket0 242485 srwxrwx--- 2 root wheel 0 Jul 31 19:02:04 2005 sockethard1 242485 srwxrwx--- 2 root wheel 0 Jul 31 19:02:04 2005 sockethard2 ls -liT dstdir 242500 lrwxrwxrwx 1 root wheel 1 Jul 31 19:24:38 2005 a -> b 242518 -rw-r----- 1 root wheel 0 Jul 31 05:07:23 2005 b 242504 prw-rw---- 1 root wheel 0 Jul 31 19:06:16 2005 fifo0 242507 prw-rw---- 1 root wheel 0 Jul 31 19:04:09 2005 fifohard1 242511 prw-rw---- 1 root wheel 0 Jul 31 19:04:09 2005 fifohard2 242519 -rw-rw---- 1 root wheel 0 Jul 31 19:06:16 2005 file0 242520 -rw-rw---- 2 root wheel 0 Jul 31 00:58:38 2005 filehard1 242520 -rw-rw---- 2 root wheel 0 Jul 31 00:58:38 2005 filehard2 242512 crw-rw---- 1 root wheel 2, 2 Jul 31 19:06:16 2005 null0 242513 crw-rw---- 1 root wheel 2, 2 Jul 31 19:05:55 2005 nullhard1 242514 crw-rw---- 1 root wheel 2, 2 Jul 31 19:05:55 2005 nullhard2 242515 srwxrwx--- 1 root wheel 0 Jul 31 19:06:16 2005 socket0 242516 srwxrwx--- 1 root wheel 0 Jul 31 19:02:04 2005 sockethard1 242517 srwxrwx--- 1 root wheel 0 Jul 31 19:02:04 2005 sockethard2 i also vaguely recall that user/group/perm/mtime updates to non-regular files [hardlinked and/or not?] may be recreating them on new inodes as opposed to just updating those bits. will confirm this behavior later. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=2933 noreply@cpe-24-95-90-2.columbus.res.rr.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | ------- Additional Comments From noreply@cpe-24-95-90-2.columbus.res.rr.com 2005-07-31 19:42 ------- patch works. dated... cvs co -D '2005-08-01 00:00:00-0000' very cool, thanks! about the last part... chmod of a socket/fifo/device in src causes the dst to use new inodes for them whether the src types are hardlinked or not. the idea is to have... find <dst> -ls > pre twiddle some <src> modes for the above types rsync -Haxv --delete <src> <dst> find <dst> -ls > post diff pre post, be the same except for mode. create/delete/chown/chgrp/mtime are already ok per below. referring only to fifo/sock/dev here, slink/regfile tested ok. HERE OK... ls -liT srcdir 240854 lrw-rw---x 1 root wheel 1 Jul 31 05:07:23 2005 a -> b 240848 -rw-rw---x 1 root wheel 0 Jul 31 05:07:23 2005 b 240860 prw-rw---x 1 www www 0 Jul 31 22:08:27 2005 fifo0 242281 prw-rw---x 2 www www 0 Jul 31 22:08:27 2005 fifohard1 242281 prw-rw---x 2 www www 0 Jul 31 22:08:27 2005 fifohard2 240853 -rw-rw---x 1 root wheel 0 Jul 31 21:54:04 2005 file0 240852 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard1 240852 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard2 242266 crw-rw---x 1 www www 2, 2 Jul 31 22:08:27 2005 null0 242484 crw-rw---x 2 www www 2, 2 Jul 31 22:08:27 2005 nullhard1 242484 crw-rw---x 2 www www 2, 2 Jul 31 22:08:27 2005 nullhard2 240846 srw-rw---x 1 www www 0 Jul 31 22:08:27 2005 socket0 242485 srw-rw---x 2 www www 0 Jul 31 22:08:27 2005 sockethard1 242485 srw-rw---x 2 www www 0 Jul 31 22:08:27 2005 sockethard2 ls -liT dstdir 241072 lrw-rw---x 1 root wheel 1 Jul 31 05:07:23 2005 a -> b 241199 -rw-rw---x 1 root wheel 0 Jul 31 05:07:23 2005 b 241193 prw-rw---x 1 www www 0 Jul 31 22:08:27 2005 fifo0 241194 prw-rw---x 2 www www 0 Jul 31 22:08:27 2005 fifohard1 241194 prw-rw---x 2 www www 0 Jul 31 22:08:27 2005 fifohard2 241202 -rw-rw---x 1 root wheel 0 Jul 31 21:54:04 2005 file0 241200 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard1 241200 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard2 241195 crw-rw---x 1 www www 2, 2 Jul 31 22:08:27 2005 null0 241196 crw-rw---x 2 www www 2, 2 Jul 31 22:08:27 2005 nullhard1 241196 crw-rw---x 2 www www 2, 2 Jul 31 22:08:27 2005 nullhard2 241197 srw-rw---x 1 www www 0 Jul 31 22:08:27 2005 socket0 241198 srw-rw---x 2 www www 0 Jul 31 22:08:27 2005 sockethard1 241198 srw-rw---x 2 www www 0 Jul 31 22:08:27 2005 sockethard2 chown -h ftp:bind {fifo,socket,null}{hard?,0} touch {fifo,socket,null}{hard?,0} rsync -Haxv --delete ./srcdir/ ./dstdir/ ls -liT dstdir 241072 lrw-rw---x 1 root wheel 1 Jul 31 05:07:23 2005 a -> b 241199 -rw-rw---x 1 root wheel 0 Jul 31 05:07:23 2005 b 241193 prw-rw---x 1 ftp bind 0 Jul 31 22:10:36 2005 fifo0 241194 prw-rw---x 2 ftp bind 0 Jul 31 22:10:36 2005 fifohard1 241194 prw-rw---x 2 ftp bind 0 Jul 31 22:10:36 2005 fifohard2 241202 -rw-rw---x 1 root wheel 0 Jul 31 21:54:04 2005 file0 241200 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard1 241200 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard2 241195 crw-rw---x 1 ftp bind 2, 2 Jul 31 22:10:36 2005 null0 241196 crw-rw---x 2 ftp bind 2, 2 Jul 31 22:10:36 2005 nullhard1 241196 crw-rw---x 2 ftp bind 2, 2 Jul 31 22:10:36 2005 nullhard2 241197 srw-rw---x 1 ftp bind 0 Jul 31 22:10:36 2005 socket0 241198 srw-rw---x 2 ftp bind 0 Jul 31 22:10:36 2005 sockethard1 241198 srw-rw---x 2 ftp bind 0 Jul 31 22:10:36 2005 sockethard2 HERE NOT OK... chmod -h 0660 {fifo,socket,null}{hard?,0} rsync -Haxv --delete ./srcdir/ ./dstdir/ fifo0 fifohard2 fifohard1 => fifohard2 null0 nullhard2 nullhard1 => nullhard2 socket0 sockethard2 sockethard1 => sockethard2 ls -liT dstdir 241072 lrw-rw---x 1 root wheel 1 Jul 31 05:07:23 2005 a -> b 241199 -rw-rw---x 1 root wheel 0 Jul 31 05:07:23 2005 b 241201 prw-rw---- 1 ftp bind 0 Jul 31 22:10:36 2005 fifo0 241203 prw-rw---- 2 ftp bind 0 Jul 31 22:10:36 2005 fifohard1 241203 prw-rw---- 2 ftp bind 0 Jul 31 22:10:36 2005 fifohard2 241202 -rw-rw---x 1 root wheel 0 Jul 31 21:54:04 2005 file0 241200 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard1 241200 -rw-rw---x 2 root wheel 0 Jul 31 21:55:05 2005 filehard2 241204 crw-rw---- 1 ftp bind 2, 2 Jul 31 22:10:36 2005 null0 241205 crw-rw---- 2 ftp bind 2, 2 Jul 31 22:10:36 2005 nullhard1 241205 crw-rw---- 2 ftp bind 2, 2 Jul 31 22:10:36 2005 nullhard2 241206 srw-rw---- 1 ftp bind 0 Jul 31 22:10:36 2005 socket0 241207 srw-rw---- 2 ftp bind 0 Jul 31 22:10:36 2005 sockethard1 241207 srw-rw---- 2 ftp bind 0 Jul 31 22:10:36 2005 sockethard2 note that none of this is tested with -H --link-dest yet. not sure whether this should be reopen or new. thx. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=2933 ------- Additional Comments From wayned@samba.org 2005-07-31 21:14 ------- Created an attachment (id=1345) --> (https://bugzilla.samba.org/attachment.cgi?id=1345&action=view) Allow devices (etc.) to get their permissions updated Rsync has from time immemorial recreated a device/fifo/socket if the permissions changed (though I hadn't noticed it before now). The fix is to mask off the permissions bits when comparing the st_mode values. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=2933 wayned@samba.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED ------- Additional Comments From wayned@samba.org 2005-07-31 21:16 -------> not sure whether this should be reopen or new. thx.I consider it a different bug (since rsync recreated devices with or without -H), but it's a fixed different bug. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=2933 ------- Additional Comments From noreply@cpe-24-95-90-2.columbus.res.rr.com 2005-08-02 00:19 ------- yep, squished, thx. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
Reasonably Related Threads
- [Bug 2947] stdout with [-v] -H --link-dest and slink/sock/fifo/regf
- DO NOT REPLY [Bug 3692] New: regression: symlinks are created as hardlinks with --link-dest
- File permissions
- No stats under FreeBSD 10.3
- net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied