- don't LBUG if MDS recovery times out during orphan cleanup (2530)
- fix destroying of named logs (2325)
- overwrite old logs when running lconf --write_conf (2264)
+ - bump LLOG_CHUNKSIZE to 8k to allow for larger clusters (2306)
2004-03-04 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.2.0
struct llog_rec_tail lgr_tail;
};
/* On-disk header structure of each log object, stored in little endian order */
-#define LLOG_CHUNK_SIZE 4096
+#define LLOG_CHUNK_SIZE 8192
#define LLOG_HEADER_SIZE (96)
#define LLOG_BITMAP_BYTES (LLOG_CHUNK_SIZE - LLOG_HEADER_SIZE)
#include <linux/lprocfs_status.h>
/* OBD Device Declarations */
-#define MAX_OBD_DEVICES 128
+#define MAX_OBD_DEVICES 256
extern struct obd_device obd_dev[MAX_OBD_DEVICES];
/* OBD Operations Declarations */
rc = llog_lvfs_read_blob(obd, handle->lgh_file, handle->lgh_hdr,
LLOG_CHUNK_SIZE, 0);
- if (rc)
+ if (rc) {
CERROR("error reading log header\n");
+ } else {
+ struct llog_rec_hdr *llh_hdr = &handle->lgh_hdr->llh_hdr;
+ /*
+ * These need to be fixed for bug 1987
+ */
+ if (llh_hdr->lrh_type != LLOG_HDR_MAGIC) {
+ CERROR("bad log header magic: %#x (expecting %#x)\n",
+ llh_hdr->lrh_type, LLOG_HDR_MAGIC);
+ rc = -EIO;
+ } else if (llh_hdr->lrh_len != LLOG_CHUNK_SIZE) {
+ CERROR("incorrectly sized log header: %#x "
+ "(expecting %#x)\n",
+ llh_hdr->lrh_len, LLOG_CHUNK_SIZE);
+ CERROR("you may need to re-run lconf --write_conf.\n");
+ rc = -EIO;
+ }
+ }
+
handle->lgh_last_idx = handle->lgh_hdr->llh_tail.lrt_index;
handle->lgh_file->f_pos = handle->lgh_file->f_dentry->d_inode->i_size;
struct ptlrpc_request *req = NULL;
struct llogd_body *body;
struct llog_log_hdr *hdr;
+ struct llog_rec_hdr *llh_hdr;
int size = sizeof(*body);
int repsize = sizeof (*hdr);
int rc;
CERROR ("Can't unpack llog_hdr\n");
GOTO(out, rc =-EFAULT);
}
+
memcpy(handle->lgh_hdr, hdr, sizeof (*hdr));
handle->lgh_last_idx = handle->lgh_hdr->llh_tail.lrt_index;
+ /* sanity checks */
+ llh_hdr = &handle->lgh_hdr->llh_hdr;
+ if (llh_hdr->lrh_type != LLOG_HDR_MAGIC) {
+ CERROR("bad log header magic: %#x (expecting %#x)\n",
+ llh_hdr->lrh_type, LLOG_HDR_MAGIC);
+ rc = -EIO;
+ } else if (llh_hdr->lrh_len != LLOG_CHUNK_SIZE) {
+ CERROR("incorrectly sized log header: %#x "
+ "(expecting %#x)\n",
+ llh_hdr->lrh_len, LLOG_CHUNK_SIZE);
+ CERROR("you may need to re-run lconf --write_conf.\n");
+ rc = -EIO;
+ }
+
out:
if (req)
ptlrpc_req_finished(req);
(long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_tail));
/* Checks for struct llog_log_hdr */
- LASSERTF((int)sizeof(struct llog_log_hdr) == 4096, " found %lld\n",
+ LASSERTF((int)sizeof(struct llog_log_hdr) == 8192, " found %lld\n",
(long long)(int)sizeof(struct llog_log_hdr));
LASSERTF(offsetof(struct llog_log_hdr, llh_hdr) == 0, " found %lld\n",
(long long)offsetof(struct llog_log_hdr, llh_hdr));
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_reserved));
LASSERTF(offsetof(struct llog_log_hdr, llh_bitmap) == 88, " found %lld\n",
(long long)offsetof(struct llog_log_hdr, llh_bitmap));
- LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 4000, " found %lld\n",
+ LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 8096, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap));
- LASSERTF(offsetof(struct llog_log_hdr, llh_tail) == 4088, " found %lld\n",
+ LASSERTF(offsetof(struct llog_log_hdr, llh_tail) == 8184, " found %lld\n",
(long long)offsetof(struct llog_log_hdr, llh_tail));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tail));
(long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_tail));
/* Checks for struct llog_log_hdr */
- LASSERTF((int)sizeof(struct llog_log_hdr) == 4096, " found %lld\n",
+ LASSERTF((int)sizeof(struct llog_log_hdr) == 8192, " found %lld\n",
(long long)(int)sizeof(struct llog_log_hdr));
LASSERTF(offsetof(struct llog_log_hdr, llh_hdr) == 0, " found %lld\n",
(long long)offsetof(struct llog_log_hdr, llh_hdr));
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_reserved));
LASSERTF(offsetof(struct llog_log_hdr, llh_bitmap) == 88, " found %lld\n",
(long long)offsetof(struct llog_log_hdr, llh_bitmap));
- LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 4000, " found %lld\n",
+ LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 8096, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap));
- LASSERTF(offsetof(struct llog_log_hdr, llh_tail) == 4088, " found %lld\n",
+ LASSERTF(offsetof(struct llog_log_hdr, llh_tail) == 8184, " found %lld\n",
(long long)offsetof(struct llog_log_hdr, llh_tail));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tail));