Whamcloud - gitweb
LU-7772 llog: do not destroy llog twice 62/18362/3
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Tue, 9 Feb 2016 13:00:04 +0000 (16:00 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Apr 2016 02:51:59 +0000 (02:51 +0000)
if llog_process_thread() finds a llog corrupted, then it cancels
all remaining records which in turn causes destroy of this llog.
but it's still referenced by the catalog's in-code structures
(chd_head list) and llog_cat_close() at umount tries to destroy
this llog again. we can reset LLOG_F_ZAP_WHEN_EMPTY at destroy,
so it never repeats.

Change-Id: I8173d9dd2971fa5cce613e71555ca04e96b5512b
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/18362
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>

index 971c643..174347c 100644 (file)
@@ -262,6 +262,8 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
             (loghandle->u.phd.phd_cat_handle != NULL &&
              loghandle->u.phd.phd_cat_handle->u.chd.chd_current_log !=
                loghandle))) {
+               /* never try to destroy it again */
+               llh->llh_flags &= ~LLOG_F_ZAP_WHEN_EMPTY;
                rc = llog_trans_destroy(env, loghandle, th);
                if (rc < 0) {
                        /* Sigh, can not destroy the final plain llog, but