From: Jian Yu Date: Thu, 18 Jan 2018 06:20:16 +0000 (-0800) Subject: LU-10503 flr: fix error handling in mirror_extend_file() X-Git-Tag: 2.10.58~46 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F14%2F30914%2F2;p=fs%2Flustre-release.git LU-10503 flr: fix error handling in mirror_extend_file() This patch fixes the error handling issues in mirror_extend_file(). Change-Id: I388295886657cf9b9b072017002be937a9e657c0 Test-Parameters: trivial testlist=sanity-flr Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/30914 Reviewed-by: Bobi Jam Tested-by: Jenkins Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 40ed514..3a387c4 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -1444,18 +1444,22 @@ static int mirror_extend_file(const char *fname, const char *victim_file, rc = llapi_file_flush(fd); if (rc < 0) { error_loc = "cannot get data version"; - return rc; + goto out; } rc = llapi_file_flush(fdv); if (rc < 0) { error_loc = "cannot get data version"; - return rc; + goto out; } /* Make sure we keep original atime/mtime values */ rc = migrate_copy_timestamps(fd, fdv); + if (rc < 0) { + error_loc = "cannot copy timestamp"; + goto out; + } /* Atomically put lease, swap layouts and close. * for a migration we need to check data version on file did