Whamcloud - gitweb
LU-14474 llog: don't destroy next llog
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 21 Sep 2021 12:23:56 +0000 (15:23 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Jan 2022 06:08:48 +0000 (06:08 +0000)
do not destroy empty llog if it's referenced as
the next one in a catalog.

Lustre-change: https://review.whamcloud.com/44998
Lustre-commit: 4521f6af35d1dc20b531b87ff3633d89dbac86ec

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I78bfeb90435aaee2b8536b647aa3acec56642ea0
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/45892
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/obdclass/llog_cat.c

index be53767..a2d4709 100644 (file)
@@ -837,7 +837,8 @@ static int llog_cat_process_common(const struct lu_env *env,
        hdr = (*llhp)->lgh_hdr;
        if ((hdr->llh_flags & LLOG_F_ZAP_WHEN_EMPTY) &&
            hdr->llh_count == 1 && cat_llh->lgh_obj != NULL &&
-           *llhp != cat_llh->u.chd.chd_current_log) {
+           *llhp != cat_llh->u.chd.chd_current_log &&
+           *llhp != cat_llh->u.chd.chd_next_log) {
                rc = llog_destroy(env, *llhp);
                if (rc)
                        CWARN("%s: can't destroy empty log "DFID": rc = %d\n",