rsyncing devices

Dave Dykstra dwd at bell-labs.com
Tue Dec 4 02:27:50 EST 2001


On Sun, Dec 02, 2001 at 04:14:15PM +1100, Martin Pool wrote:
> On 27 Nov 2001, Dave Dykstra <dwd at bell-labs.com> wrote:
> > I can reproduce it, and I think you've stumbled on a significant bug.  The
> > problem is that rsync always assumes stat variable "st_rdev", which
> > contains both the major and minor number, is always 4 bytes and is always
> > the same format on both sides.  On the rsync I tried on Linux, it is 8
> > bytes, whereas it was 4 bytes on Solaris.  I assume it depends on whether
> > or not 64 bit mode gets enabled on the operating system version you're on.
> 
> Are the top bits actually used?  Perhaps truncation would be
> marginally better, or perhaps we should have a ./configure warning
> that this will be broken if sizeof(st_rdev)>4?

I don't think we can assume that they're not used, although yes truncation
would be marginally better and we could probably easily have a patch that
would scrunch the major & minor device numbers down to the 32 bit format
but I think it would be better to fix it properly with a protocol change as
long as something's being changed.  I don't think it's worth a configure
warning, just fix it.



> > This will take a protocol change to fix.  I think probably rsync should
> > split out the major and minor numbers as two separate 4 byte quantities.  I
> > wonder if there are other 64 bit stat values that are being misinterpreted.
> 
> I agree, and added it to TODO.
> 
> We will need this on Linux as well, though it's anybody's guess
> whether devfs and dynamic device numbers will make it mostly
> irrelevant there.

- Dave




More information about the rsync mailing list