Whamcloud - gitweb
LU-4054 llog: don't leak llog handle in llog_cat_process_cb() 47/7847/2
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 3 Oct 2013 21:05:44 +0000 (16:05 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 4 Oct 2013 15:24:41 +0000 (15:24 +0000)
An early return from llog_cat_process_cb() was leaking the llog
handle. Fix this by not doing that.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I01e8b5f389a097f17bb1370aaec7382bc9d840c9
Reviewed-on: http://review.whamcloud.com/7847
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
lustre/obdclass/llog_cat.c

index 78e92d4..a0d7854 100644 (file)
@@ -557,11 +557,10 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
                RETURN(rc);
        }
 
-        if (rec->lrh_index < d->lpd_startcat)
-                /* Skip processing of the logs until startcat */
-                RETURN(0);
-
-        if (d->lpd_startidx > 0) {
+       if (rec->lrh_index < d->lpd_startcat) {
+               /* Skip processing of the logs until startcat */
+               rc = 0;
+       } else if (d->lpd_startidx > 0) {
                 struct llog_process_cat_data cd;
 
                 cd.lpcd_first_idx = d->lpd_startidx;
@@ -574,6 +573,7 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
                rc = llog_process_or_fork(env, llh, d->lpd_cb, d->lpd_data,
                                          NULL, false);
        }
+
        llog_handle_put(llh);
 
        RETURN(rc);