int flags, struct obd_uuid *uuid)
{
struct llog_log_hdr *llh;
+ enum llog_flag fmt = flags & LLOG_F_EXT_MASK;
int rc;
ENTRY;
flags, LLOG_F_IS_CAT, LLOG_F_IS_PLAIN);
rc = -EINVAL;
}
+ llh->llh_flags |= fmt;
out:
if (rc) {
OBD_FREE_PTR(llh);
if (rc)
GOTO(out, rc);
- /* NB: when rec->lrh_len is accessed it is already swabbed
- * since it is used at the "end" of the loop and the rec
- * swabbing is done at the beginning of the loop. */
- for (rec = (struct llog_rec_hdr *)buf;
- (char *)rec < buf + LLOG_CHUNK_SIZE;
- rec = (struct llog_rec_hdr *)((char *)rec + rec->lrh_len)){
+ /* NB: when rec->lrh_len is accessed it is already swabbed
+ * since it is used at the "end" of the loop and the rec
+ * swabbing is done at the beginning of the loop. */
+ for (rec = (struct llog_rec_hdr *)buf;
+ (char *)rec < buf + LLOG_CHUNK_SIZE;
+ rec = llog_rec_hdr_next(rec)) {
- CDEBUG(D_OTHER, "processing rec 0x%p type %#x\n",
- rec, rec->lrh_type);
+ CDEBUG(D_OTHER, "processing rec 0x%p type %#x\n",
+ rec, rec->lrh_type);
if (LLOG_REC_HDR_NEEDS_SWABBING(rec))
lustre_swab_llog_rec(rec);
if (cd != NULL)
cd->lpcd_last_idx = last_called_index;
- if (unlikely(rc == -EIO)) {
- /* something bad happened to the processing, probably I/O
- * error or the log got corrupted..
+ if (unlikely(rc == -EIO && loghandle->lgh_obj != NULL)) {
+ /* something bad happened to the processing of a local
+ * llog file, probably I/O error or the log got corrupted..
* to be able to finally release the log we discard any
* remaining bits in the header */
- CERROR("llog found corrupted\n");
+ CERROR("Local llog found corrupted\n");
while (index <= last_index) {
if (ext2_test_bit(index, llh->llh_bitmap) != 0)
llog_cancel_rec(lpi->lpi_env, loghandle, index);