From 22d4926257cc774f514612f91a304a007dc14e63 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Wed, 17 Jan 2018 22:20:16 -0800 Subject: [PATCH] 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 --- lustre/utils/lfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 1.8.3.1