From: John L. Hammond Date: Thu, 3 Oct 2013 21:05:44 +0000 (-0500) Subject: LU-4054 llog: don't leak llog handle in llog_cat_process_cb() X-Git-Tag: 2.5.0~10 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=26c55b24d8745f3384370c8dcf1c1f302e19805d;p=fs%2Flustre-release.git LU-4054 llog: don't leak llog handle in llog_cat_process_cb() 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 Change-Id: I01e8b5f389a097f17bb1370aaec7382bc9d840c9 Reviewed-on: http://review.whamcloud.com/7847 Tested-by: Hudson Reviewed-by: Andreas Dilger Reviewed-by: jacques-Charles Lafoucriere Tested-by: Maloo Reviewed-by: Mike Pershin --- diff --git a/lustre/obdclass/llog_cat.c b/lustre/obdclass/llog_cat.c index 78e92d4..a0d7854 100644 --- a/lustre/obdclass/llog_cat.c +++ b/lustre/obdclass/llog_cat.c @@ -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);