Whamcloud - gitweb
LU-5683 llite: Report first encountered error 35/14335/3
authorHenri Doreau <henri.doreau@cea.fr>
Thu, 2 Apr 2015 12:09:58 +0000 (14:09 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 28 Apr 2015 05:20:49 +0000 (05:20 +0000)
Failures in ll_ioc_copy_{start,end} are reported to coordinator.
The return code delivered to the caller should indicate what this
error was, not whether coordinator was succesfully notified.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Change-Id: Iffcfe060be25ac071c7c314f33607292ed314d6a
Reviewed-on: http://review.whamcloud.com/14335
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dir.c

index d38c9f0..6d41cdd 100644 (file)
@@ -725,7 +725,8 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy)
 {
        struct ll_sb_info               *sbi = ll_s2sbi(sb);
        struct hsm_progress_kernel       hpk;
-       int                              rc;
+       int                              rc = 0;
+       int                              rc2;
        ENTRY;
 
        /* Forge a hsm_progress based on data from copy. */
@@ -776,10 +777,12 @@ progress:
        /* On error, the request should be considered as completed */
        if (hpk.hpk_errval > 0)
                hpk.hpk_flags |= HP_FLAG_COMPLETED;
-       rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
-                          &hpk, NULL);
 
-       RETURN(rc);
+       rc2 = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
+                           &hpk, NULL);
+
+       /* Return first error */
+       RETURN(rc != 0 ? rc : rc2);
 }
 
 /**
@@ -801,7 +804,8 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
 {
        struct ll_sb_info               *sbi = ll_s2sbi(sb);
        struct hsm_progress_kernel       hpk;
-       int                              rc;
+       int                              rc = 0;
+       int                              rc2;
        ENTRY;
 
        /* If you modify the logic here, also check llapi_hsm_copy_end(). */
@@ -875,10 +879,11 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
        }
 
 progress:
-       rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
-                          &hpk, NULL);
+       rc2 = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
+                           &hpk, NULL);
 
-       RETURN(rc);
+       /* Return first error */
+       RETURN(rc != 0 ? rc : rc2);
 }