Whamcloud - gitweb
LU-10503 flr: fix error handling in mirror_extend_file() 14/30914/2
authorJian Yu <jian.yu@intel.com>
Thu, 18 Jan 2018 06:20:16 +0000 (22:20 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 25 Jan 2018 04:48:14 +0000 (04:48 +0000)
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 <jian.yu@intel.com>
Reviewed-on: https://review.whamcloud.com/30914
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lfs.c

index 40ed514..3a387c4 100644 (file)
@@ -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