Whamcloud - gitweb
LU-6167 utils: fix bugs in lustre_sync 45/13545/3
authorWu Libin <lwu@ddn.com>
Wed, 28 Jan 2015 05:55:20 +0000 (13:55 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 8 Feb 2015 02:40:48 +0000 (02:40 +0000)
The lustre_rsync will cause endloop and core dump problems, this
patch fix this problems. In function lr_cascade_move, it should
delete "curr" node in the "parents" list first, then move to the
next lr_cascade_move.

Signed-off-by: Wu Libin <lwu@ddn.com>
Change-Id: I5a5686ab89379da37453d07a5a00df4fd217ee59
Reviewed-on: http://review.whamcloud.com/13545
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lustre_rsync.c

index e27df3e..086dc21 100644 (file)
@@ -674,11 +674,11 @@ void lr_cascade_move(const char *fid, const char *dest, struct lr_info *info)
                                         info->src, d, errno);
                                 errors++;
                         }
                                         info->src, d, errno);
                                 errors++;
                         }
-                        lr_cascade_move(curr->pc_log.pcl_tfid, d, info);
                         if (curr == parents)
                                 parents = curr->pc_next;
                         else
                                 prev->pc_next = curr->pc_next;
                         if (curr == parents)
                                 parents = curr->pc_next;
                         else
                                 prev->pc_next = curr->pc_next;
+                       lr_cascade_move(curr->pc_log.pcl_tfid, d, info);
                         free(curr);
                         prev = curr = parents;
 
                         free(curr);
                         prev = curr = parents;