From: jacob Date: Wed, 10 Mar 2004 22:31:06 +0000 (+0000) Subject: b=2306 X-Git-Tag: 1.2.2~210 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=87600c58e26518244824613106892a447b33a7ef;p=fs%2Flustre-release.git b=2306 r=phil, andreas bump LLOG_CHUNKSIZE to 8k to allow for larger clusters --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 4209127..729a23e 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -8,6 +8,7 @@ tbd Cluster File Systems, Inc. - 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. * version 1.2.0 diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index c0452ea..72804d1 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -955,7 +955,7 @@ struct llog_gen_rec { 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) diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index 6c97a05..c7848b3 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -44,7 +44,7 @@ #include /* 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 */ diff --git a/lustre/obdclass/llog_lvfs.c b/lustre/obdclass/llog_lvfs.c index ba8798a..168a004 100644 --- a/lustre/obdclass/llog_lvfs.c +++ b/lustre/obdclass/llog_lvfs.c @@ -162,8 +162,26 @@ static int llog_lvfs_read_header(struct llog_handle *handle) 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; diff --git a/lustre/ptlrpc/llog_client.c b/lustre/ptlrpc/llog_client.c index d34e5e2..1098b40 100644 --- a/lustre/ptlrpc/llog_client.c +++ b/lustre/ptlrpc/llog_client.c @@ -169,6 +169,7 @@ static int llog_client_read_header(struct llog_handle *handle) 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; @@ -193,9 +194,24 @@ static int llog_client_read_header(struct llog_handle *handle) 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); diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index f34f5f2..f424e53 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -2011,7 +2011,7 @@ void lustre_assert_wire_constants(void) (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)); @@ -2051,9 +2051,9 @@ void lustre_assert_wire_constants(void) (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)); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 849b0f0..ed317f9 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1368,7 +1368,7 @@ void lustre_assert_wire_constants(void) (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)); @@ -1408,9 +1408,9 @@ void lustre_assert_wire_constants(void) (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));