Got rid of the check_for_io_err code, as it could cause a hang.
authorWayne Davison <wayned@samba.org>
Sun, 31 Aug 2008 14:27:11 +0000 (07:27 -0700)
committerWayne Davison <wayned@samba.org>
Sun, 31 Aug 2008 16:51:29 +0000 (09:51 -0700)
The io_error issue will be fixed in a better way in 3.1.0.

NEWS
generator.c
io.c
main.c
rsync.c

diff --git a/NEWS b/NEWS
index 1808f1514e1f669729bd2af72e0b89326b760298..d7e20ae2f817834084a6b04de780f8d08853b1b0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,9 +34,6 @@ Changes since 3.0.3:
     - When using --iconv, if a server-side receiver can't convert a filename,
       it now outputs the name back to the client without mangling the charset.
 
-    - Fixed a bug where --delete-during could delete in a directory before it
-      noticed that the sending side sent an I/O error for that directory.
-
     - Fixed a potential alignment issue in the IRIX ACL code when allocating
       the initial "struct acl" object.  Also, cast mallocs to avoid warnings.
 
index 0b4e2cb0d575c22d02f293e0ea09a9a51aef9b6b..762391d76e19dbe3397aed6e673cd5516d8dc3f1 100644 (file)
@@ -89,7 +89,6 @@ extern int unsort_ndx;
 extern int max_delete;
 extern int force_delete;
 extern int one_file_system;
-extern int check_for_io_err;
 extern struct stats stats;
 extern dev_t filesystem_dev;
 extern mode_t orig_umask;
@@ -2237,10 +2236,6 @@ void generate_files(int f_out, const char *local_name)
                                                dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
                                        } else
                                                dirdev = MAKEDEV(0, 0);
-                                       /* We must be sure we've had a chance to receive an I/O
-                                        * error for this directory before we delete in it. */
-                                       while (check_for_io_err && !cur_flist->next && !flist_eof)
-                                               wait_for_receiver();
                                        delete_in_dir(fbuf, fp, &dirdev);
                                } else
                                        change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
diff --git a/io.c b/io.c
index 21e8134f45ecb0fdfab0c6345b8e790b44a54927..f8712dd1f79223e2668e38ea116eb42277b06803 100644 (file)
--- a/io.c
+++ b/io.c
@@ -64,7 +64,6 @@ const char phase_unknown[] = "unknown";
 int ignore_timeout = 0;
 int batch_fd = -1;
 int msgdone_cnt = 0;
-int check_for_io_err = 0;
 
 /* Ignore an EOF error if non-zero. See whine_about_eof(). */
 int kluge_around_eof = 0;
@@ -378,8 +377,6 @@ static void read_msg_fd(void)
        len = tag & 0xFFFFFF;
        tag = (tag >> 24) - MPLEX_BASE;
 
-       check_for_io_err = 0;
-
        switch (tag) {
        case MSG_DONE:
                if (len < 0 || len > 1 || !am_generator) {
@@ -414,9 +411,6 @@ static void read_msg_fd(void)
                }
                flist = recv_file_list(fd);
                flist->parent_ndx = IVAL(buf,0);
-               /* If the sender is going to send us an MSG_IO_ERROR value, it
-                * will always be the very next message following MSG_FLIST. */
-               check_for_io_err = 1;
 #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links)
                        match_hard_links(flist);
@@ -572,7 +566,7 @@ void send_msg_int(enum msgcode code, int num)
 
 void wait_for_receiver(void)
 {
-       if (io_flush(FULL_FLUSH))
+       if (io_flush(NORMAL_FLUSH))
                return;
        read_msg_fd();
 }
@@ -1064,8 +1058,6 @@ static int readfd_unbuffered(int fd, char *buf, size_t len)
                msg_bytes = tag & 0xFFFFFF;
                tag = (tag >> 24) - MPLEX_BASE;
 
-               check_for_io_err = 0;
-
                switch (tag) {
                case MSG_DATA:
                        if (msg_bytes > iobuf_in_siz) {
diff --git a/main.c b/main.c
index 887f8d27022b208a37e74e670ab9601cea4a0db0..6881c8e65bc7c9f3e128e8c27dcca93fd07de60b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -63,11 +63,8 @@ extern int whole_file;
 extern int read_batch;
 extern int write_batch;
 extern int batch_fd;
-extern int flist_eof;
 extern int filesfrom_fd;
-extern int delete_during;
 extern int connect_timeout;
-extern int check_for_io_err;
 extern pid_t cleanup_child_pid;
 extern unsigned int module_dirlen;
 extern struct stats stats;
@@ -762,8 +759,6 @@ static int do_recv(int f_in, int f_out, char *local_name)
                exit_cleanup(RERR_IPC);
        }
 
-       check_for_io_err = inc_recurse && delete_during && !flist_eof;
-
        if (pid == 0) {
                close(error_pipe[0]);
                if (f_in != f_out)
diff --git a/rsync.c b/rsync.c
index 50a50ba0fe3dd4f8b88a2668846960394ee3dc98..30f5a07fe4d0508633c32f20c44cb9a8e0f5d24d 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -48,8 +48,6 @@ extern int inplace;
 extern int flist_eof;
 extern int keep_dirlinks;
 extern int make_backups;
-extern int delete_during;
-extern int check_for_io_err;
 extern struct file_list *cur_flist, *first_flist, *dir_flist;
 extern struct chmod_mode_struct *daemon_chmod_modes;
 #ifdef ICONV_OPTION
@@ -255,15 +253,8 @@ int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr,
        while (1) {
                ndx = read_ndx(f_in);
 
-               if (ndx >= 0) {
-                       if (check_for_io_err) {
-                               /* Let generator know there was no I/O error. */
-                               send_msg_int(MSG_IO_ERROR, 0);
-                               check_for_io_err = 0;
-                       }
+               if (ndx >= 0)
                        break;
-               }
-               check_for_io_err = 0;
                if (ndx == NDX_DONE)
                        return ndx;
                if (!inc_recurse || am_sender) {
@@ -305,10 +296,6 @@ int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr,
                flist->parent_ndx = ndx;
                stop_flist_forward();
                verbose = save_verbose;
-               /* If the sender is going to send us an MSG_IO_ERROR value, it
-                * will always be the very next message following a file list. */
-               if (delete_during)
-                       check_for_io_err = 1;
        }
 
        iflags = protocol_version >= 29 ? read_shortint(f_in)