From 00d17ba5fdd04581b835d8514e05568aa619573f Mon Sep 17 00:00:00 2001 From: phil Date: Tue, 9 Sep 2003 00:39:05 +0000 Subject: [PATCH] - clear 'rc' if rc == LLOG_EMPTY in llog_init_handle, so we don't free the header and return an error that our caller doesn't expect - don't call llog_lvfs_pad if left == reclen, only if 0 < left < reclen - fix the uuid magic in llog_test - call llog_init_handle in the right places, and don't forget to close the log if one of the 1a checks fail --- lustre/obdclass/llog.c | 1 + lustre/obdclass/llog_lvfs.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/obdclass/llog.c b/lustre/obdclass/llog.c index 73cbb6b..2def1dc 100644 --- a/lustre/obdclass/llog.c +++ b/lustre/obdclass/llog.c @@ -126,6 +126,7 @@ int llog_init_handle(struct llog_handle *handle, int flags, } else if (rc != LLOG_EEMPTY) { GOTO(out, rc); } + rc = 0; llh->llh_hdr.lrh_type = LLOG_HDR_MAGIC; llh->llh_hdr.lrh_len = llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE; diff --git a/lustre/obdclass/llog_lvfs.c b/lustre/obdclass/llog_lvfs.c index 8505614..7eeb6a8 100644 --- a/lustre/obdclass/llog_lvfs.c +++ b/lustre/obdclass/llog_lvfs.c @@ -216,7 +216,7 @@ static int llog_lvfs_write_rec(struct llog_handle *loghandle, reclen = sizeof(*rec) + size_round(rec->lrh_len) + sizeof(struct llog_rec_tail); - if (left != 0 && left <= reclen) { + if (left != 0 && left < reclen) { loghandle->lgh_last_idx++; rc = llog_lvfs_pad(file, left, loghandle->lgh_last_idx); if (rc) -- 1.8.3.1