Whamcloud - gitweb
LU-7799 hsm: use correct record start index for actions 25/18525/2
authorJohn L. Hammond <john.hammond@intel.com>
Fri, 19 Feb 2016 19:09:55 +0000 (13:09 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 14 Mar 2016 02:42:43 +0000 (02:42 +0000)
In mdt_hsm_actions_proc_show() pass index of the last printed record
to the startidx of llog_cat_process(). This avoids an issue where the
next record to be printed would have been skipped.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ic8516d6a9429a21bf1f8d435d60bc9e8801982a5
Reviewed-on: http://review.whamcloud.com/18525
Tested-by: Jenkins
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_hsm_cdt_actions.c

index 59cbfe2..9d61d53 100644 (file)
@@ -370,7 +370,7 @@ static void *mdt_hsm_actions_proc_start(struct seq_file *s, loff_t *pos)
        /* first call = rewind */
        if (*pos == 0) {
                aai->aai_cat_index = 0;
        /* first call = rewind */
        if (*pos == 0) {
                aai->aai_cat_index = 0;
-               aai->aai_index = -1;
+               aai->aai_index = 0;
                aai->aai_eof = false;
                *pos = 1;
        }
                aai->aai_eof = false;
                *pos = 1;
        }
@@ -471,7 +471,7 @@ static int mdt_hsm_actions_proc_show(struct seq_file *s, void *v)
        mutex_lock(&cdt->cdt_llog_lock);
        rc = llog_cat_process(&aai->aai_env, aai->aai_ctxt->loc_handle,
                              hsm_actions_show_cb, s,
        mutex_lock(&cdt->cdt_llog_lock);
        rc = llog_cat_process(&aai->aai_env, aai->aai_ctxt->loc_handle,
                              hsm_actions_show_cb, s,
-                             aai->aai_cat_index, aai->aai_index + 1);
+                             aai->aai_cat_index, aai->aai_index);
        mutex_unlock(&cdt->cdt_llog_lock);
        if (rc == 0) /* all llog parsed */
                aai->aai_eof = true;
        mutex_unlock(&cdt->cdt_llog_lock);
        if (rc == 0) /* all llog parsed */
                aai->aai_eof = true;