]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Undo the hard-link xattr optimization in 78286a03.
authorWayne Davison <wayned@samba.org>
Sun, 19 Jan 2014 22:59:43 +0000 (14:59 -0800)
committerWayne Davison <wayned@samba.org>
Sun, 19 Jan 2014 22:59:43 +0000 (14:59 -0800)
I'm backing out the xattr optimization that was put in to try
to make xattr data sending more optimal on hard-linked files.
The code was causing hard-to-reproduce bugs, and it's better to
get things done fully & correctly over fully optimally.

generator.c
receiver.c
sender.c

index b2ca2e05b5caa98ec2a297b0ed7f962a7d05d4fa..0f77481ebfd0efd680f51426dd04095f10e494d8 100644 (file)
@@ -550,9 +550,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
 #ifdef SUPPORT_XATTRS
                        if (preserve_xattrs && do_xfers
                         && iflags & (ITEM_REPORT_XATTR|ITEM_TRANSFER)) {
-                               int fd = iflags & ITEM_REPORT_XATTR
-                                     && (protocol_version < 31 || !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE))
-                                      ? sock_f_out : -1;
+                               int fd = iflags & ITEM_REPORT_XATTR ? sock_f_out : -1;
                                send_xattr_request(NULL, file, fd);
                        }
 #endif
index 1e064d9dd65a02da9946992fb1ced98683a86d1c..48540d2ecd06803155bb38034a4e25121973c490 100644 (file)
@@ -580,16 +580,14 @@ int recv_files(int f_in, int f_out, char *local_name)
                        rprintf(FINFO, "recv_files(%s)\n", fname);
 
 #ifdef SUPPORT_XATTRS
-               if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
-                && (protocol_version < 31 || !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
+               if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers)
                        recv_xattr_request(file, f_in);
 #endif
 
                if (!(iflags & ITEM_TRANSFER)) {
                        maybe_log_item(file, iflags, itemizing, xname);
 #ifdef SUPPORT_XATTRS
-                       if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
-                        && !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE))
+                       if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers)
                                set_file_attrs(fname, file, NULL, fname, 0);
 #endif
                        if (iflags & ITEM_IS_NEW) {
index 12242abecd79d31b0f217772bd03ddde43a73afb..5ecb6eac305884d52a990f4576daa4ca8ae0b2e6 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -177,8 +177,7 @@ static void write_ndx_and_attrs(int f_out, int ndx, int iflags,
        if (iflags & ITEM_XNAME_FOLLOWS)
                write_vstring(f_out, buf, len);
 #ifdef SUPPORT_XATTRS
-       if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
-        && (protocol_version < 31 || !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
+       if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers)
                send_xattr_request(fname, file, f_out);
 #endif
 }