X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fllog_test.c;h=e3edd02aee7ab81e502d976e83900422d2b3b9a9;hb=e87585ce9b9a9975e05e5b02623777b7322233f9;hp=f8e6de1bd59634c333bc919814d3af17b735f41e;hpb=ff17cc7e0282d9b1522810e0c5d12171c4d46a2d;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index f8e6de1..e3edd02 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -489,6 +489,42 @@ parse_out: RETURN(rc); } +static int llog_test_7(struct obd_device *obd) +{ + struct llog_ctxt *ctxt = llog_get_context(obd, LLOG_TEST_ORIG_CTXT); + struct llog_handle *llh; + struct llog_create_rec lcr; + char name[10]; + int rc; + ENTRY; + + sprintf(name, "%x", llog_test_rand+2); + CWARN("7: create a log with name: %s\n", name); + LASSERT(ctxt); + + rc = llog_create(ctxt, &llh, NULL, name); + if (rc) { + CERROR("7: llog_create with name %s failed: %d\n", name, rc); + RETURN(rc); + } + llog_init_handle(llh, LLOG_F_IS_PLAIN, &uuid); + + lcr.lcr_hdr.lrh_len = lcr.lcr_tail.lrt_len = cpu_to_le32(sizeof(lcr)); + lcr.lcr_hdr.lrh_type = cpu_to_le32(OST_SZ_REC); + rc = llog_write_rec(llh, &lcr.lcr_hdr, NULL, 0, NULL, -1); + if (rc) { + CERROR("7: write one log record failed: %d\n", rc); + RETURN(rc); + } + + rc = llog_destroy(llh); + if (rc) + CERROR("7: llog_destroy failed: %d\n", rc); + else + llog_free_handle(llh); + RETURN(rc); +} + /* ------------------------------------------------------------------------- * Tests above, boring obd functions below * ------------------------------------------------------------------------- */ @@ -529,6 +565,10 @@ static int llog_run_tests(struct obd_device *obd) if (rc) GOTO(cleanup, rc); + rc = llog_test_7(obd); + if (rc) + GOTO(cleanup, rc); + cleanup: switch (cleanup_phase) { case 1: