summaryrefslogtreecommitdiff
path: root/sender.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2014-06-08 10:22:09 -0700
committerWayne Davison <wayned@samba.org>2014-06-08 10:42:14 -0700
commitff08acd4f24e74019dd75420fd8373fad563c1af (patch)
treedd08d095b23b7e5a075d731ecc7829789756de93 /sender.c
parent03bb593f812ac0a1c4a6b38d333e31f149f3a451 (diff)
downloadrsync-ff08acd4f24e74019dd75420fd8373fad563c1af.tar.gz
Added a flag to disable xattr hlink optimization.
I added a compatibility flag for protocol 31 that will let both sides know if they should be using the xattr optimization that attempted to avoid sending xattr info for hardlinked files. Since this optimization was causing some issues, this compatibility flag will ensure that both sides know if they should be trying to use the optimization or not.
Diffstat (limited to 'sender.c')
-rw-r--r--sender.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sender.c b/sender.c
index 38743447..5adc2fd8 100644
--- a/sender.c
+++ b/sender.c
@@ -29,6 +29,7 @@ extern int inc_recurse;
extern int log_before_transfer;
extern int stdout_format_has_i;
extern int logfile_format_has_i;
+extern int want_xattr_optim;
extern int csum_length;
extern int append_mode;
extern int io_error;
@@ -177,7 +178,8 @@ 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)
+ if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
+ && !(want_xattr_optim && BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
send_xattr_request(fname, file, f_out);
#endif
}
@@ -258,7 +260,8 @@ void send_files(int f_in, int f_out)
rprintf(FINFO, "send_files(%d, %s%s%s)\n", ndx, path,slash,fname);
#ifdef SUPPORT_XATTRS
- if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers)
+ if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
+ && !(want_xattr_optim && BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
recv_xattr_request(file, f_in);
#endif