Whamcloud - gitweb
b=2306
authorjacob <jacob>
Wed, 10 Mar 2004 22:31:06 +0000 (22:31 +0000)
committerjacob <jacob>
Wed, 10 Mar 2004 22:31:06 +0000 (22:31 +0000)
r=phil, andreas

bump LLOG_CHUNKSIZE to 8k to allow for larger clusters

lustre/ChangeLog
lustre/include/linux/lustre_idl.h
lustre/include/linux/obd_class.h
lustre/obdclass/llog_lvfs.c
lustre/ptlrpc/llog_client.c
lustre/ptlrpc/pack_generic.c
lustre/utils/wiretest.c

index 4209127..729a23e 100644 (file)
@@ -8,6 +8,7 @@ tbd  Cluster File Systems, Inc. <info@clusterfs.com>
        - 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
index c0452ea..72804d1 100644 (file)
@@ -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)
 
index 6c97a05..c7848b3 100644 (file)
@@ -44,7 +44,7 @@
 #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 */
index ba8798a..168a004 100644 (file)
@@ -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;
index d34e5e2..1098b40 100644 (file)
@@ -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);
index f34f5f2..f424e53 100644 (file)
@@ -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));
index 849b0f0..ed317f9 100644 (file)
@@ -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));