The patches for 3.2.7pre1.
[rsync-patches.git] / checksum-reading.diff
index dc8adce435e5195fd985479195cb9e17a4853301..5c1466a370e5b8df85e5371900c510c755b6b42f 100644 (file)
@@ -16,7 +16,7 @@ To use this patch, run these commands for a successful build:
     ./configure                               (optional if already run)
     make
 
-based-on: 0327a2526b8f3e6c050e4541805b8b702ba5d7ce
+based-on: ed4b3448be243b1bdb30a5da811f1e217f5a0601
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
@@ -29,7 +29,7 @@ diff --git a/clientserver.c b/clientserver.c
  extern int io_timeout;
  extern int no_detach;
  extern int write_batch;
-@@ -1033,6 +1035,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -1106,6 +1108,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
        } else if (am_root < 0) /* Treat --fake-super from client as --super. */
                am_root = 2;
  
@@ -66,9 +66,9 @@ diff --git a/flist.c b/flist.c
  extern int inc_recurse;
  extern int always_checksum;
 +extern int basis_dir_cnt;
- extern int checksum_type;
  extern int module_id;
  extern int ignore_errors;
+ extern int numeric_ids;
 @@ -62,6 +64,7 @@ extern int implied_dirs;
  extern int ignore_perishable;
  extern int non_perishable_cnt;
@@ -77,15 +77,15 @@ diff --git a/flist.c b/flist.c
  extern int copy_links;
  extern int copy_unsafe_links;
  extern int protocol_version;
-@@ -73,6 +76,7 @@ extern int sender_symlink_iconv;
- extern int output_needs_newline;
+@@ -74,6 +77,7 @@ extern int output_needs_newline;
  extern int sender_keeps_checksum;
+ extern int trust_sender_filter;
  extern int unsort_ndx;
 +extern char *basis_dir[];
  extern uid_t our_uid;
  extern struct stats stats;
  extern char *filesfrom_host;
-@@ -90,6 +94,20 @@ extern int filesfrom_convert;
+@@ -92,6 +96,20 @@ extern int filesfrom_convert;
  extern iconv_t ic_send, ic_recv;
  #endif
  
@@ -106,7 +106,7 @@ diff --git a/flist.c b/flist.c
  #define PTR_SIZE (sizeof (struct file_struct *))
  
  int io_error;
-@@ -134,8 +152,12 @@ static char empty_sum[MAX_DIGEST_LEN];
+@@ -136,8 +154,12 @@ static char empty_sum[MAX_DIGEST_LEN];
  static int flist_count_offset; /* for --delete --progress */
  static int show_filelist_progress;
  
@@ -120,7 +120,7 @@ diff --git a/flist.c b/flist.c
  static void output_flist(struct file_list *flist);
  
  void init_flist(void)
-@@ -324,6 +346,235 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -329,6 +351,235 @@ static void flist_done_allocating(struct file_list *flist)
                flist->pool_boundary = ptr;
  }
  
@@ -230,7 +230,7 @@ diff --git a/flist.c b/flist.c
 +
 +      while (fgets(line, sizeof line, fp)) {
 +              cp = line;
-+              if (checksum_type == 5) {
++              if (file_sum_nni->num == CSUM_MD5) {
 +                      char *alt_sum = cp;
 +                      if (*cp == '=')
 +                              while (*++cp == '=') {}
@@ -265,7 +265,7 @@ diff --git a/flist.c b/flist.c
 +                      break;
 +              while (*++cp == ' ') {}
 +
-+              if (checksum_type != 5) {
++              if (file_sum_nni->num < CSUM_MD5) {
 +                      char *alt_sum = cp;
 +                      if (*cp == '=')
 +                              while (*++cp == '=') {}
@@ -356,7 +356,7 @@ diff --git a/flist.c b/flist.c
  /* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
   * F_PATHNAME(), or (2) "NULL, dir, dirlen" to chdir() to the supplied dir,
   * with dir == NULL taken to be the starting directory, and dirlen < 0
-@@ -1200,7 +1451,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1231,7 +1482,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                              STRUCT_STAT *stp, int flags, int filter_level)
  {
        static char *lastdir;
@@ -365,7 +365,7 @@ diff --git a/flist.c b/flist.c
        struct file_struct *file;
        char thisname[MAXPATHLEN];
        char linkname[MAXPATHLEN];
-@@ -1346,9 +1597,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1377,9 +1628,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                        memcpy(lastdir, thisname, len);
                        lastdir[len] = '\0';
                        lastdir_len = len;
@@ -383,7 +383,7 @@ diff --git a/flist.c b/flist.c
        basename_len = strlen(basename) + 1; /* count the '\0' */
  
  #ifdef SUPPORT_LINKS
-@@ -1366,11 +1624,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1409,11 +1667,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                extra_len += EXTRA_LEN;
  #endif
  
@@ -397,7 +397,7 @@ diff --git a/flist.c b/flist.c
  
  #if EXTRA_ROUNDING > 0
        if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1459,8 +1714,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1502,8 +1757,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                return NULL;
        }
  
@@ -414,7 +414,7 @@ diff --git a/flist.c b/flist.c
  
        if (unsort_ndx)
                F_NDX(file) = stats.num_dirs;
-@@ -2672,7 +2933,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2720,7 +2981,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
        /* The --relative option sends paths with a leading slash, so we need
         * to specify the strip_root option here.  We rejected leading slashes
         * for a non-relative transfer in recv_file_entry(). */
@@ -423,7 +423,7 @@ diff --git a/flist.c b/flist.c
  
        if (protocol_version < 30) {
                /* Recv the io_error flag */
-@@ -2917,7 +3178,7 @@ void flist_free(struct file_list *flist)
+@@ -2965,7 +3226,7 @@ void flist_free(struct file_list *flist)
  
  /* This routine ensures we don't have any duplicate names in our file list.
   * duplicate names can cause corruption because of the pipelining. */
@@ -432,7 +432,7 @@ diff --git a/flist.c b/flist.c
  {
        char fbuf[MAXPATHLEN];
        int i, prev_i;
-@@ -2968,7 +3229,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -3016,7 +3277,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
                        /* If one is a dir and the other is not, we want to
                         * keep the dir because it might have contents in the
                         * list.  Otherwise keep the first one. */
@@ -441,7 +441,7 @@ diff --git a/flist.c b/flist.c
                                struct file_struct *fp = flist->sorted[j];
                                if (!S_ISDIR(fp->mode))
                                        keep = i, drop = j;
-@@ -2984,8 +3245,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -3032,8 +3293,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
                        } else
                                keep = j, drop = i;
  
@@ -452,7 +452,7 @@ diff --git a/flist.c b/flist.c
                                        rprintf(FINFO,
                                            "removing duplicate name %s from file list (%d)\n",
                                            f_name(file, fbuf), drop + flist->ndx_start);
-@@ -3007,7 +3268,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -3055,7 +3316,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
        }
        flist->high = prev_i;
  
@@ -464,7 +464,7 @@ diff --git a/flist.c b/flist.c
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
-@@ -52,6 +52,7 @@ extern int delete_after;
+@@ -54,6 +54,7 @@ extern int delete_after;
  extern int missing_args;
  extern int msgdone_cnt;
  extern int ignore_errors;
@@ -472,37 +472,46 @@ diff --git a/generator.c b/generator.c
  extern int remove_source_files;
  extern int delay_updates;
  extern int update_only;
-@@ -601,7 +602,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -614,7 +615,7 @@ static enum filetype get_file_type(mode_t mode)
+ }
  
  /* Perform our quick-check heuristic for determining if a file is unchanged. */
--int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
-+int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st, int slot)
+-int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file, STRUCT_STAT *st)
++int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file, STRUCT_STAT *st, int slot)
  {
-       if (st->st_size != F_LENGTH(file))
-               return 0;
-@@ -610,7 +611,10 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
-          of the file time to determine whether to sync */
-       if (always_checksum > 0 && S_ISREG(st->st_mode)) {
-               char sum[MAX_DIGEST_LEN];
--              file_checksum(fn, st, sum);
-+              if (checksum_files && slot >= 0)
-+                      get_cached_checksum(slot, fn, file, st, sum);
-+              else
-+                      file_checksum(fn, st, sum);
-               return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
-       }
+       switch (ftype) {
+         case FT_REG:
+@@ -625,7 +626,10 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
+                * of the file mtime to determine whether to sync. */
+               if (always_checksum > 0) {
+                       char sum[MAX_DIGEST_LEN];
+-                      file_checksum(fn, st, sum);
++                      if (checksum_files && slot >= 0)
++                              get_cached_checksum(slot, fn, file, st, sum);
++                      else
++                              file_checksum(fn, st, sum);
+                       return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
+               }
  
-@@ -907,7 +911,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -956,7 +960,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
                        best_match = j;
                        match_level = 1;
                }
--              if (!unchanged_file(cmpbuf, file, &sxp->st))
-+              if (!unchanged_file(cmpbuf, file, &sxp->st, j+1))
+-              if (!quick_check_ok(FT_REG, cmpbuf, file, &sxp->st))
++              if (!quick_check_ok(FT_REG, cmpbuf, file, &sxp->st, j+1))
                        continue;
                if (match_level == 1) {
                        best_match = j;
-@@ -1220,7 +1224,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1079,7 +1083,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+                       match_level = 1;
+                       best_match = j;
+               }
+-              if (!quick_check_ok(ftype, cmpbuf, file, &sxp->st))
++              if (!quick_check_ok(ftype, cmpbuf, file, &sxp->st, j+1))
+                       continue;
+               if (match_level < 2) {
+                       match_level = 2;
+@@ -1215,7 +1219,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
         * --ignore-non-existing, daemon exclude, or mkdir failure. */
        static struct file_struct *skip_dir = NULL;
        static struct file_list *fuzzy_dirlist[MAX_BASIS_DIRS+1];
@@ -511,7 +520,7 @@ diff --git a/generator.c b/generator.c
        struct file_struct *fuzzy_file = NULL;
        int fd = -1, f_copy = -1;
        stat_x sx, real_sx;
-@@ -1337,8 +1341,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1332,8 +1336,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                                                fuzzy_dirlist[i] = NULL;
                                        }
                                }
@@ -523,11 +532,11 @@ diff --git a/generator.c b/generator.c
  #ifdef SUPPORT_ACLS
                        if (!preserve_perms)
                                dflt_perms = default_perms_for_dir(dn);
-@@ -1346,6 +1351,24 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1341,6 +1346,24 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                }
                parent_dirname = dn;
  
-+              if (need_new_dirscan && S_ISREG(file->mode)) {
++              if (need_new_dirscan && ftype == FT_REG) {
 +                      int i;
 +                      strlcpy(fnamecmpbuf, dn, sizeof fnamecmpbuf);
 +                      for (i = 0; i < fuzzy_basis; i++) {
@@ -548,11 +557,38 @@ diff --git a/generator.c b/generator.c
                statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
                stat_errno = errno;
        }
-@@ -1749,22 +1772,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1387,7 +1410,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+                       if (INFO_GTE(SKIP, 2)) {
+                               if (ftype != stype)
+                                       suf = " (type change)";
+-                              else if (!quick_check_ok(ftype, fname, file, &sx.st))
++                              else if (!quick_check_ok(ftype, fname, file, &sx.st, 0))
+                                       suf = always_checksum ? " (sum change)" : " (file change)";
+                               else if (!unchanged_attrs(fname, file, &sx))
+                                       suf = " (attr change)";
+@@ -1558,7 +1581,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+                       goto cleanup;
+               }
+               if (statret == 0) {
+-                      if (stype == FT_SYMLINK && quick_check_ok(stype, fname, file, &sx.st)) {
++                      if (stype == FT_SYMLINK && quick_check_ok(stype, fname, file, &sx.st, 0)) {
+                               /* The link is pointing to the right place. */
+                               set_file_attrs(fname, file, &sx, NULL, maybe_ATTRS_REPORT);
+                               if (itemizing)
+@@ -1627,7 +1650,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+               if (statret == 0) {
+                       if (ftype != stype)
+                               statret = -1;
+-                      else if (quick_check_ok(ftype, fname, file, &sx.st)) {
++                      else if (quick_check_ok(ftype, fname, file, &sx.st, 0)) {
+                               /* The device or special file is identical. */
+                               set_file_attrs(fname, file, &sx, NULL, maybe_ATTRS_REPORT);
+                               if (itemizing)
+@@ -1752,22 +1775,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                partialptr = NULL;
  
        if (statret != 0 && fuzzy_basis) {
--              if (need_fuzzy_dirlist && S_ISREG(file->mode)) {
+-              if (need_fuzzy_dirlist) {
 -                      const char *dn = file->dirname ? file->dirname : ".";
 -                      int i;
 -                      strlcpy(fnamecmpbuf, dn, sizeof fnamecmpbuf);
@@ -571,12 +607,12 @@ diff --git a/generator.c b/generator.c
                /* Sets fnamecmp_type to FNAMECMP_FUZZY or above. */
                fuzzy_file = find_fuzzy(file, fuzzy_dirlist, &fnamecmp_type);
                if (fuzzy_file) {
-@@ -1797,7 +1804,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1806,7 +1813,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                ;
        else if (fnamecmp_type >= FNAMECMP_FUZZY)
                ;
--      else if (unchanged_file(fnamecmp, file, &sx.st)) {
-+      else if (unchanged_file(fnamecmp, file, &sx.st, fnamecmp_type == FNAMECMP_FNAME ? 0 : -1)) {
+-      else if (quick_check_ok(FT_REG, fnamecmp, file, &sx.st)) {
++      else if (quick_check_ok(FT_REG, fnamecmp, file, &sx.st, fnamecmp_type == FNAMECMP_FNAME ? 0 : -1)) {
                if (partialptr) {
                        do_unlink(partialptr);
                        handle_partial_dir(partialptr, PDIR_DELETE);
@@ -587,8 +623,8 @@ diff --git a/hlink.c b/hlink.c
                                }
                                break;
                        }
--                      if (!unchanged_file(cmpbuf, file, &alt_sx.st))
-+                      if (!unchanged_file(cmpbuf, file, &alt_sx.st, j+1))
+-                      if (!quick_check_ok(FT_REG, cmpbuf, file, &alt_sx.st))
++                      if (!quick_check_ok(FT_REG, cmpbuf, file, &alt_sx.st, j+1))
                                continue;
                        statret = 1;
                        if (unchanged_attrs(cmpbuf, file, &alt_sx))
@@ -612,7 +648,7 @@ diff --git a/loadparm.c b/loadparm.c
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
-@@ -120,6 +120,7 @@ size_t bwlimit_writemax = 0;
+@@ -126,6 +126,7 @@ size_t bwlimit_writemax = 0;
  int ignore_existing = 0;
  int ignore_non_existing = 0;
  int need_messages_from_generator = 0;
@@ -620,16 +656,16 @@ diff --git a/options.c b/options.c
  int max_delete = INT_MIN;
  OFF_T max_size = -1;
  OFF_T min_size = -1;
-@@ -794,7 +795,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -581,7 +582,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
        OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
        OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
        OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_BLOCK_SIZE,
 -      OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT, OPT_STDERR,
 +      OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT, OPT_STDERR, OPT_SUMFILES,
-       OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS,
+       OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS, OPT_OLD_ARGS,
        OPT_STOP_AFTER, OPT_STOP_AT,
        OPT_REFUSED_BASE = 9000};
-@@ -950,6 +951,7 @@ static struct poptOption long_options[] = {
+@@ -738,6 +739,7 @@ static struct poptOption long_options[] = {
    {"no-c",             0,  POPT_ARG_VAL,    &always_checksum, 0, 0, 0 },
    {"checksum-choice",  0,  POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
    {"cc",               0,  POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
@@ -637,7 +673,7 @@ diff --git a/options.c b/options.c
    {"block-size",      'B', POPT_ARG_STRING, 0, OPT_BLOCK_SIZE, 0, 0 },
    {"compare-dest",     0,  POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
    {"copy-dest",        0,  POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
-@@ -1955,6 +1957,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1746,6 +1748,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        }
                        break;
  
@@ -661,7 +697,7 @@ diff --git a/options.c b/options.c
                case OPT_INFO:
                        arg = poptGetOptArg(pc);
                        parse_output_words(info_words, info_levels, arg, USER_PRIORITY);
-@@ -2285,6 +2304,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2099,6 +2118,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
        }
  #endif
  
@@ -674,33 +710,33 @@ diff --git a/options.c b/options.c
 diff --git a/rsync.1.md b/rsync.1.md
 --- a/rsync.1.md
 +++ b/rsync.1.md
-@@ -338,6 +338,7 @@ detailed description below for a complete description.
+@@ -386,6 +386,7 @@ has its own detailed description later in this manpage.
  --quiet, -q              suppress non-error messages
  --no-motd                suppress daemon-mode MOTD
  --checksum, -c           skip based on checksum, not mod-time & size
 +--sumfiles=MODE          use .rsyncsums to speedup --checksum mode
- --archive, -a            archive mode; equals -rlptgoD (no -H,-A,-X)
+ --archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
  --no-OPTION              turn off an implied OPTION (e.g. --no-D)
  --recursive, -r          recurse into directories
-@@ -698,6 +699,8 @@ your home directory (remove the '=' for that).
+@@ -778,6 +779,8 @@ expand it.
      file that has the same size as the corresponding sender's file: files with
      either a changed size or a changed checksum are selected for transfer.
  
-+    See also the `--sumfiles` option for a way to use cached checksum data.
++    See also the [`--sumfiles`](#opt) option for a way to use cached checksum data.
 +
      Note that rsync always verifies that each _transferred_ file was correctly
      reconstructed on the receiving side by checking a whole-file checksum that
      is generated as the file is transferred, but that automatic
-@@ -708,6 +711,38 @@ your home directory (remove the '=' for that).
-     can be overridden using either the `--checksum-choice` (`--cc`) option or an
-     environment variable that is discussed in that option's section.
+@@ -789,6 +792,38 @@ expand it.
+     option or an environment variable that is discussed in that option's
+     section.
  
 +0.  `--sumfiles=MODE`
 +
 +    This option tells rsync to make use of any cached checksum information it
 +    finds in per-directory .rsyncsums files when the current transfer is using
-+    the `--checksum` option.  If the checksum data is up-to-date, it is used
-+    instead of recomputing it, saving both disk I/O and CPU time.  If the
++    the [`--checksum`](#opt) option.  If the checksum data is up-to-date, it is
++    used instead of recomputing it, saving both disk I/O and CPU time.  If the
 +    checksum data is missing or outdated, the checksum is computed just as it
 +    would be if `--sumfiles` was not specified.
 +
@@ -710,16 +746,16 @@ diff --git a/rsync.1.md b/rsync.1.md
 +    or update these files, but there is a perl script in the support directory
 +    named "rsyncsums" that can be used for that.
 +
-+    This option has no effect unless `--checksum`, `-c` was also specified.  It
-+    also only affects the current side of the transfer, so if you want the
-+    remote side to parse its own .rsyncsums files, specify the option via
-+    `--remote-option` (`-M`) (e.g. "`-M--sumfiles=lax`").
++    This option has no effect unless [`--checksum`](#opt) (`-c`) was also
++    specified.  It also only affects the current side of the transfer, so if
++    you want the remote side to parse its own .rsyncsums files, specify the
++    option via [`--remote-option`](#opt) (`-M`) (e.g. "`-M--sumfiles=lax`").
 +
 +    To avoid transferring the system's checksum files, you can use an exclude
-+    (e.g. `--exclude=.rsyncsums`).  To make this easier to type, you can use a
-+    popt alias.  For instance, adding the following line in your ~/.popt file
-+    defines a `--cs` option that enables lax checksum files and excludes the
-+    checksum files:
++    (e.g. [`--exclude=.rsyncsums`](#opt)).  To make this easier to type, you
++    can use a popt alias.  For instance, adding the following line in your
++    ~/.popt file defines a `--cs` option that enables lax checksum files and
++    excludes the checksum files:
 +
 +    >     rsync alias --cs -c --sumfiles=lax -M--sumfiles=lax -f-_.rsyncsums
 +
@@ -733,7 +769,7 @@ diff --git a/rsync.1.md b/rsync.1.md
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -878,6 +878,10 @@ extern int xattrs_ndx;
+@@ -903,6 +903,10 @@ extern int file_sum_extra_cnt;
  #define F_SUM(f) ((char*)OPT_EXTRA(f, START_BUMP(f) + HLINK_BUMP(f) \
                                    + SUM_EXTRA_CNT - 1))
  
@@ -744,7 +780,7 @@ diff --git a/rsync.h b/rsync.h
  /* Some utility defines: */
  #define F_IS_ACTIVE(f) (f)->basename[0]
  #define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -1090,6 +1094,13 @@ typedef struct {
+@@ -1117,6 +1121,13 @@ typedef struct {
  #define RELNAMECACHE_LEN (offsetof(relnamecache, fname))
  #endif
  
@@ -761,7 +797,7 @@ diff --git a/rsync.h b/rsync.h
 diff --git a/rsyncd.conf.5.md b/rsyncd.conf.5.md
 --- a/rsyncd.conf.5.md
 +++ b/rsyncd.conf.5.md
-@@ -419,6 +419,19 @@ the values of parameters.  See the GLOBAL PARAMETERS section for more details.
+@@ -449,6 +449,19 @@ the values of parameters.  See the GLOBAL PARAMETERS section for more details.
      the max connections limit is not exceeded for the modules sharing the lock
      file.  The default is `/var/run/rsyncd.lock`.