From: wangdi Date: Thu, 31 May 2007 00:42:39 +0000 (+0000) Subject: Branch: b1_6 X-Git-Tag: v1_8_0_110~1565 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=8b0824f4d514d0b3568bb7122257cf235ca60d36;p=fs%2Flustre-release.git Branch: b1_6 Branch:b1_4 set cat log bitmap only after create log success b=12556 i=green i=nathan --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index f9df72c..2d53e4f 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -247,6 +247,13 @@ Details : in some rare cases, the open intent error is not checked before ASSERTION(open_req->rq_transno != 0), because it tries to release the failed open handle. +Severity : normal +Frequency : rare +Bugzilla : 12556 +Description: Set cat log bitmap only after create log success. +Details : in some rare cases, the cat log bitmap is set too early. and it + should be set only after create log success. + -------------------------------------------------------------------------------- 2007-05-03 Cluster File Systems, Inc. diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index c514d16..10678f8 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -100,6 +100,7 @@ extern int obd_race_state; #define OBD_FAIL_MDS_SETXATTR_WRITE 0x134 #define OBD_FAIL_MDS_FS_SETUP 0x135 #define OBD_FAIL_MDS_RESEND 0x136 +#define OBD_FAIL_MDS_LLOG_CREATE_FAILED 0x137 #define OBD_FAIL_OST 0x200 #define OBD_FAIL_OST_CONNECT_NET 0x201 diff --git a/lustre/obdclass/llog_cat.c b/lustre/obdclass/llog_cat.c index 9fe257a..e42fab8 100644 --- a/lustre/obdclass/llog_cat.c +++ b/lustre/obdclass/llog_cat.c @@ -65,28 +65,30 @@ static struct llog_handle *llog_cat_new_log(struct llog_handle *cathandle) if (llh->llh_cat_idx == index) { CERROR("no free catalog slots for log...\n"); RETURN(ERR_PTR(-ENOSPC)); - } else { - if (index == 0) - index = 1; - if (ext2_set_bit(index, llh->llh_bitmap)) { - CERROR("argh, index %u already set in log bitmap?\n", - index); - LBUG(); /* should never happen */ - } - cathandle->lgh_last_idx = index; - llh->llh_count++; - llh->llh_tail.lrt_index = index; } + if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_MDS_LLOG_CREATE_FAILED)) + RETURN(ERR_PTR(-ENOSPC)); + rc = llog_create(cathandle->lgh_ctxt, &loghandle, NULL, NULL); if (rc) RETURN(ERR_PTR(rc)); - + rc = llog_init_handle(loghandle, LLOG_F_IS_PLAIN | LLOG_F_ZAP_WHEN_EMPTY, &cathandle->lgh_hdr->llh_tgtuuid); if (rc) GOTO(out_destroy, rc); + if (index == 0) + index = 1; + if (ext2_set_bit(index, llh->llh_bitmap)) { + CERROR("argh, index %u already set in log bitmap?\n", + index); + LBUG(); /* should never happen */ + } + cathandle->lgh_last_idx = index; + llh->llh_count++; + llh->llh_tail.lrt_index = index; CDEBUG(D_HA, "new recovery log "LPX64":%x for index %u of catalog " LPX64"\n", loghandle->lgh_id.lgl_oid, loghandle->lgh_id.lgl_ogen,