From 485f3ba8743365c7fb5823893a7eb45030cdffb5 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Fri, 17 Apr 2015 11:37:51 +0200 Subject: [PATCH] LU-6471 obdclass: fix llog_cat_cleanup() usage on Client With patch/commit 3a83b4b9 for LU-5195, LLOG code has been strengthen against catalog inconsistency by detecting a referenced plain LLOG is missing and by clearing its associated entry by calling llog_cat_cleanup(), which now needs to handle the case where it is also executed on a Client (ie, cathandle->lgh_obj == NULL) and thus must not attempt to update on-disk catalog. Signed-off-by: Bruno Faccini Change-Id: Ie6fb9240ac76810358a91c7410046c626f42c2b9 Reviewed-on: http://review.whamcloud.com/14489 Tested-by: Jenkins Reviewed-by: Alex Zhuravlev Reviewed-by: John L. Hammond Reviewed-by: Mike Pershin Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/obdclass/llog_cat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lustre/obdclass/llog_cat.c b/lustre/obdclass/llog_cat.c index ad4782c..c8c2da3 100644 --- a/lustre/obdclass/llog_cat.c +++ b/lustre/obdclass/llog_cat.c @@ -791,6 +791,11 @@ int llog_cat_cleanup(const struct lu_env *env, struct llog_handle *cathandle, /* llog was opened and keep in a list, close it now */ llog_close(env, loghandle); } + + /* do not attempt to cleanup on-disk llog if on client side */ + if (cathandle->lgh_obj == NULL) + return 0; + /* remove plain llog entry from catalog by index */ llog_cat_set_first_idx(cathandle, index); rc = llog_cancel_rec(env, cathandle, index); -- 1.8.3.1