Whamcloud - gitweb
LU-6471 obdclass: fix llog_cat_cleanup() usage on Client 89/14489/2
authorBruno Faccini <bruno.faccini@intel.com>
Fri, 17 Apr 2015 09:37:51 +0000 (11:37 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 23 Apr 2015 14:04:05 +0000 (14:04 +0000)
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 <bruno.faccini@intel.com>
Change-Id: Ie6fb9240ac76810358a91c7410046c626f42c2b9
Reviewed-on: http://review.whamcloud.com/14489
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/llog_cat.c

index ad4782c..c8c2da3 100644 (file)
@@ -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);
        }
                /* 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);
        /* remove plain llog entry from catalog by index */
        llog_cat_set_first_idx(cathandle, index);
        rc = llog_cancel_rec(env, cathandle, index);