]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs: enlarge dump header
authorJohn Spray <john.spray@redhat.com>
Tue, 17 Nov 2015 12:00:21 +0000 (12:00 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 17 Nov 2015 12:20:31 +0000 (12:20 +0000)
This was never big enough for largest possible
numbers in the %llu formats.

Not being backwards compatible for this tool.

Signed-off-by: John Spray <john.spray@redhat.com>
src/tools/cephfs/Dumper.cc

index 060366106559057c587c55f1c65ee8e45b9ad231..bade9754edc9b4aa53145aa8a87593c192158454 100644 (file)
@@ -29,6 +29,7 @@
 
 #define dout_subsys ceph_subsys_mds
 
+#define HEADER_LEN 4096
 
 int Dumper::init(int rank_)
 {
@@ -90,7 +91,7 @@ int Dumper::dump(const char *dump_file)
   int fd = ::open(dump_file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
   if (fd >= 0) {
     // include an informative header
-    char buf[200];
+    char buf[HEADER_LEN];
     memset(buf, 0, sizeof(buf));
     sprintf(buf, "Ceph mds%d journal dump\n start offset %llu (0x%llx)\n       length %llu (0x%llx)\n    write_pos %llu (0x%llx)\n    format %llu\n    trimmed_pos %llu (0x%llx)\n%c",
            rank, 
@@ -185,7 +186,7 @@ int Dumper::undump(const char *dump_file)
   //  start offset 232401996 (0xdda2c4c)
   //        length 1097504 (0x10bf20)
 
-  char buf[200];
+  char buf[HEADER_LEN];
   r = safe_read(fd, buf, sizeof(buf));
   if (r < 0) {
     VOID_TEMP_FAILURE_RETRY(::close(fd));