OK. Didn't see anything about this in the archives, other than an old post from 2000 about a similar problem, so here goes. Feel free to contact me if I can provide anything else useful. Problem: -------- Major numbers on 64bit Solaris are being dropped, and created as 0 on recieving end. 32bit version works perfectly. Environment: ------------ Solaris 8 or Solaris 9 (haven't tried any other 64bit OSes) SunPRO cc CFLAGS = -xO2 CFLAGS += -xarch=v9 (turns on 64 bit compile) Configure: ---------- ./configure --enable-debug=no Build: ------ gmake Run: ---- ./rsync -av /devices/pseudo/ /tmp/foo Symptoms: --------- root@ti1us003# ls -l /devices/pseudo/ total 0 crw-rw-rw- 1 root sys 44, 0 Mar 30 19:30 arp@0:arp crw------- 1 root sys 11, 202 Mar 30 19:48 clone@0:bge crw------- 1 root sys 11, 8 Mar 30 19:30 clone@0:eri crw------- 1 root sys 11, 7 Mar 30 19:30 clone@0:hme crw------- 1 root sys 11, 40 Mar 30 19:30 clone@0:le crw-rw-rw- 1 root sys 11, 107 Mar 30 19:35 clone@0:llc1 crw------- 1 root sys 11, 4 Mar 30 19:35 clone@0:logindmux crw-rw-rw- 1 root sys 11, 23 Mar 30 19:35 clone@0:ptmx crw--w---- 1 root tty 0, 0 Apr 8 12:49 cn@0:console crw--w---- 1 root tty 0, 0 Apr 7 16:32 cn@0:syscon crw--w---- 1 root tty 0, 0 Mar 30 19:30 cn@0:systty ---snip--- root@ti1us003# ls -l /tmp/foo/ total 0 crw-rw-rw- 1 root sys 0, 0 Mar 30 19:30 arp@0:arp crw------- 1 root sys 0, 202 Mar 30 19:48 clone@0:bge crw------- 1 root sys 0, 8 Mar 30 19:30 clone@0:eri crw------- 1 root sys 0, 7 Mar 30 19:30 clone@0:hme crw------- 1 root sys 0, 40 Mar 30 19:30 clone@0:le crw-rw-rw- 1 root sys 0, 107 Mar 30 19:35 clone@0:llc1 crw------- 1 root sys 0, 4 Mar 30 19:35 clone@0:logindmux crw-rw-rw- 1 root sys 0, 23 Mar 30 19:35 clone@0:ptmx crw--w---- 1 root tty 0, 0 Apr 8 12:49 cn@0:console crw--w---- 1 root tty 0, 0 Apr 7 16:32 cn@0:syscon crw--w---- 1 root tty 0, 0 Mar 30 19:30 cn@0:systty ---snip--- Version/Compile info: --------------------- root@ti1us003# rsync --version rsync version 2.6.0 protocol version 27 Copyright (C) 1996-2004 by Andrew Tridgell and others <http://rsync.samba.org/> Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, no IPv6, 64-bit system inums, 64-bit internal inums Thanks Tom Williams> twilliams > at > corio > dot > com
On Thu, Apr 08, 2004 at 01:43:18PM -0700, Williams, Tom wrote:> Major numbers on 64bit Solaris are being dropped, and created as 0 on > recieving end. 32bit version works perfectly.Looks like the code is masking a 64-bit number with a 32-bit mask (ouch)! Try the attached patch and let me know if it fixes the problem. ..wayne.. -------------- next part -------------- --- flist.c 1 Apr 2004 18:04:59 -0000 1.206 +++ flist.c 8 Apr 2004 21:23:16 -0000 @@ -367,11 +367,11 @@ void send_file_entry(struct file_struct } else rdev = 0; } else if (IS_DEVICE(mode)) { - if ((file->u.rdev & ~0xFF) == rdev_high) + if ((file->u.rdev & ~(DEV64_T)0xFF) == rdev_high) flags |= XMIT_SAME_HIGH_RDEV; else { rdev = file->u.rdev; - rdev_high = rdev & ~0xFF; + rdev_high = rdev & ~(DEV64_T)0xFF; } } } @@ -594,7 +594,7 @@ void receive_file_entry(struct file_stru } else if (IS_DEVICE(mode)) { if (!(flags & XMIT_SAME_HIGH_RDEV)) { rdev = (DEV64_T)read_int(f); - rdev_high = rdev & ~0xFF; + rdev_high = rdev & ~(DEV64_T)0xFF; } else rdev = rdev_high | (DEV64_T)read_byte(f); }
On Thu, Apr 08, 2004 at 01:43:18PM -0700, Williams, Tom wrote:> rsync version 2.6.0 protocol version 27I just noticed that you aren't talking about the 2.6.1 pre-release, so that patch I just sent won't do you any good unless you first download that: http://rsync.samba.org/ftp/rsync/preview/rsync-2.6.1pre-1.tar.gz If you could retry things using the pre-release + patch, I'd appreciate it! ..wayne..
We seem to working from wildly different revs of flist.c :) Mine is the stock file from the 2.6.0 source. I don't even find an occurance of 0xFF in there, so your patch wouldn't apply, even by hand -- the code is just too different. I think I understand what you were attempting to accomplish with it though, and the relevant equivalent code in the 2.6.0 version /is/ masked as a DEV64_T if (preserve_devices && IS_DEVICE(file->mode)) file->rdev (flags & SAME_RDEV) ? last_rdev : (DEV64_T) read_int(f); Which /seems/ to do the right thing. Thanks, Tom Williams -----Original Message----- From: Wayne Davison To: Williams, Tom Cc: 'rsync@lists.samba.org' Sent: 4/8/2004 2:25 PM Subject: Re: Device majors incorrectly set to 0 during rsync On Thu, Apr 08, 2004 at 01:43:18PM -0700, Williams, Tom wrote:> Major numbers on 64bit Solaris are being dropped, and created as 0 on > recieving end. 32bit version works perfectly.Looks like the code is masking a 64-bit number with a 32-bit mask (ouch)! Try the attached patch and let me know if it fixes the problem. ..wayne.. <<dev64.patch>>
Excellent! In the meantime, the 32bit + -D_FILE_OFFSET_BITS=64 works brilliantly, so I'll wait for a release. This is meant to run on prod boxes, so I need to use a release if possible, so noone asks funny questions about beta software, etc. You know how it is. I just have to remember to compile 32bit until I see a fix go through for this one. Thanks for your help :) Tom Williams -----Original Message----- From: Wayne Davison To: Williams, Tom Cc: 'rsync@lists.samba.org' Sent: 4/8/2004 2:42 PM Subject: Re: Device majors incorrectly set to 0 during rsync On Thu, Apr 08, 2004 at 02:33:29PM -0700, Wayne Davison wrote:> If you could retry things using the pre-release + patch, I'd > appreciate it!Note that my patch won't fix the problem because rsync only transmits the lower 32 bits of the rdev value. To fix this will require a protocol change. I'll consider that. Comments welcomed. ..wayne..
Apparently Analagous Threads
- patches for copying atimes
- DO NOT REPLY [Bug 6280] New: (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris
- Using USB Tape drive on Centos 5.3 (kernel 2.6.18-164.10.1.el5PAE)
- 2.5.2 will not compile
- problem loading initrd