Whamcloud - gitweb
LU-5859 llog: do not cleanup orphans in remote catalogs
[fs/lustre-release.git] / lustre / obdclass / llog_cat.c
index 853b17e..e7114cf 100644 (file)
@@ -550,9 +550,10 @@ static int llog_cat_process_cb(const struct lu_env *env,
        }
 
        /* clean old empty llogs, do not consider current llog in use */
        }
 
        /* clean old empty llogs, do not consider current llog in use */
+       /* ignore remote (lgh_obj=NULL) llogs */
        hdr = llh->lgh_hdr;
        if ((hdr->llh_flags & LLOG_F_ZAP_WHEN_EMPTY) &&
        hdr = llh->lgh_hdr;
        if ((hdr->llh_flags & LLOG_F_ZAP_WHEN_EMPTY) &&
-           hdr->llh_count == 1 &&
+           hdr->llh_count == 1 && cat_llh->lgh_obj != NULL &&
            llh != cat_llh->u.chd.chd_current_log) {
                rc = llog_destroy(env, llh);
                if (rc)
            llh != cat_llh->u.chd.chd_current_log) {
                rc = llog_destroy(env, llh);
                if (rc)