From: Li Xi Date: Fri, 22 May 2015 04:07:00 +0000 (+0800) Subject: LU-6229 utils: fix lustre_rsync bug of cascade move X-Git-Tag: 2.7.65~81 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b9f3c954ef00c83ea34d0e3d7474f2b27eac29b8 LU-6229 utils: fix lustre_rsync bug of cascade move When replaying the changelog, destination files have to be put into a special directory, if their parent directory is possessing a different path other than the ultimate path because of renaming. With the replaying process going on, when the parent directory is being moved to the ultimate path, the child files should be moved under the parent directory which is called cascade move. As long as a directory has child files under sepcial direcoty, cascade move should happen, no matter the direcotry is being renamed from sepcial direcoty or not. This patch fixes the problem that cascade move is missing when the direcotry is being renamed from ordinary path. Signed-off-by: Li Xi Change-Id: I2d21604b81fe0cf08df1af2bfccc90a32986bf05 Reviewed-on: http://review.whamcloud.com/14914 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/lustre_rsync.c b/lustre/utils/lustre_rsync.c index 1830ac1..112a21c 100644 --- a/lustre/utils/lustre_rsync.c +++ b/lustre/utils/lustre_rsync.c @@ -959,12 +959,12 @@ int lr_move(struct lr_info *info) lr_debug(DINFO, "rename returns %d\n", rc1); } - if (special_src) { + if (special_src) rc1 = lr_remove_pc(info->spfid, info->sfid); - if (!special_dest) - lr_cascade_move(info->sfid, info->dest, info); - } - if (special_dest) + + if (!special_dest) + lr_cascade_move(info->sfid, info->dest, info); + else rc1 = lr_add_pc(info->pfid, info->sfid, info->name); lr_debug(DINFO, "move: %s [to] %s rc1=%d, errno=%d\n",