+ logid = lgh->lgh_id;
+
+ lmr.lmr_hdr.lrh_len = lmr.lmr_tail.lrt_len = LLOG_MIN_REC_SIZE;
+ lmr.lmr_hdr.lrh_type = 0xf02f02;
+
+ /* Check llog header values are correct after record add/cancel */
+ CWARN("2b: write 1 llog records, check llh_count\n");
+ rc = llog_write(env, lgh, &lmr.lmr_hdr, LLOG_NEXT_IDX);
+ if (rc < 0)
+ GOTO(out_close, rc);
+
+ /* in-memory values after record addition */
+ rc = verify_handle("2b", lgh, 2);
+ if (rc < 0)
+ GOTO(out_close, rc);
+
+ /* re-open llog to read on-disk values */
+ llog_close(env, lgh);
+
+ CWARN("2c: re-open the log by LOGID and verify llh_count\n");
+ rc = llog_open(env, ctxt, &lgh, &logid, NULL, LLOG_OPEN_EXISTS);
+ if (rc < 0) {
+ CERROR("2c: re-open log by LOGID failed\n");
+ GOTO(out_close_llh, rc);
+ }
+
+ rc = llog_init_handle(env, lgh, LLOG_F_IS_PLAIN, &uuid);
+ if (rc < 0) {
+ CERROR("2c: can't init llog handle: %d\n", rc);
+ GOTO(out_close, rc);
+ }