Bug with crtimes and hard links? - Tools

This is a discussion on Bug with crtimes and hard links? - Tools ; I've been getting spurious unnecessary copying of files on OSX when using the crtimes patch and the --crtimes -H options (version 3.0.4). I can reliably demonstrate it (on OSX 10.5) by doing this several times (as root): rsync -v -N ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Bug with crtimes and hard links?

  1. Bug with crtimes and hard links?


    I've been getting spurious unnecessary copying of files on OSX when
    using the crtimes patch and the --crtimes -H options (version 3.0.4).

    I can reliably demonstrate it (on OSX 10.5) by doing this several
    times (as root):
    rsync -v -N -axHAX --delete-during --fileflags --force-change /usr/
    bin/ /tmp/foo/


    I think I've tracked it down to the hard-link processing code in
    recv_file_entry() in flist.c around line 751:

    Essentially, all hard links but the first will get their modtime set
    correctly (from first->modtime), but their crtime is inherited
    (incorrectly) from the previous invocation of recv_file_entry.

    The obvious idea would be to add a crtime field to file_struct but
    that looks like it has some large potential impact and
    I'm afraid I don't know the rsync codebase sufficiently to want to
    attempt a fix.


    -- Chris

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  2. Re: Bug with crtimes and hard links?

    On Fri, Sep 26, 2008 at 05:42:40PM -0700, Chris Roehrig wrote:
    > I've been getting spurious unnecessary copying of files on OSX when using
    > the crtimes patch and the --crtimes -H options (version 3.0.4).


    This appears to be a lack of initializing the stat_x crtime value to 0 in
    the hlink.c code. Please try out the attached patch.

    ...wayne..

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

  3. Re: Bug with crtimes and hard links?

    Thanks Wayne,
    Your patch didn't fix it, but this one seem to work:





    (It turns out that file_struct does have a crtime embedded in it; I
    just didn't see it at first).

    -- Chris

    On Sep 27, 2008, at 6:28, Wayne Davison wrote:

    > On Fri, Sep 26, 2008 at 05:42:40PM -0700, Chris Roehrig wrote:
    >> I've been getting spurious unnecessary copying of files on OSX when
    >> using
    >> the crtimes patch and the --crtimes -H options (version 3.0.4).

    >
    > This appears to be a lack of initializing the stat_x crtime value to
    > 0 in
    > the hlink.c code. Please try out the attached patch.
    >
    > ..wayne..
    >



    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

  4. Re: Bug with crtimes and hard links?

    On Sat, Sep 27, 2008 at 01:21:42PM -0700, Chris Roehrig wrote:
    > Your patch didn't fix it, but this one seem to work:


    Yup, that is indeed the right thing to do. Thanks!

    ...wayne..
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    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 to Thread