lib/tdb2: fix error string formatting.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 14 Mar 2012 03:07:51 +0000 (13:37 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 14 Mar 2012 04:09:30 +0000 (05:09 +0100)
This caused a crash on PPC64 when we failed the mmap (found by failtest,
reported by Amitay)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/tdb2/io.c
lib/tdb2/tdb1_check.c
lib/tdb2/tdb1_io.c

index b4a6f0beae11160ac37ab7987d957c81e92612ac..5634922db3a7b5498601e5a4f54227b1c3f9652d 100644 (file)
@@ -134,8 +134,8 @@ static enum TDB_ERROR tdb_oob(struct tdb_context *tdb,
                        return TDB_SUCCESS;
 
                tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_ERROR,
-                          "tdb_oob len %llu beyond eof at %zu",
-                          (long long)(off + len), st.st_size);
+                          "tdb_oob len %llu beyond eof at %llu",
+                          (long long)(off + len), (long long)st.st_size);
                return TDB_ERR_IO;
        }
 
index a8e54b2ee092f4cb7e1866818551e4e6177f1e5b..68f8f8183cb41f4abedabedaaf751cbf0d61382c 100644 (file)
@@ -420,7 +420,8 @@ int tdb1_check(struct tdb_context *tdb,
 
                        tdb_logerr(tdb, TDB_SUCCESS, TDB_LOG_WARNING,
                                   "Dead space at %d-%d (of %u)\n",
-                                  off, off + dead, tdb->file->map_size);
+                                  off, off + dead,
+                                  (unsigned)tdb->file->map_size);
                        rec.rec_len = dead - sizeof(rec);
                        break;
                case TDB1_RECOVERY_MAGIC:
index f3d139d0434a97fc7c9dbb6a4deea6cb6d2cd43e..e7d20b8cfcfe847595b9ae36f8f1588819c4dc00 100644 (file)
@@ -230,8 +230,9 @@ void tdb1_mmap(struct tdb_context *tdb)
                if (tdb->file->map_ptr == MAP_FAILED) {
                        tdb->file->map_ptr = NULL;
                        tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_WARNING,
-                                  "tdb1_mmap failed for size %d (%s)",
-                                  tdb->file->map_size, strerror(errno));
+                                  "tdb1_mmap failed for size %llu (%s)",
+                                  (long long)tdb->file->map_size,
+                                  strerror(errno));
                }
        } else {
                tdb->file->map_ptr = NULL;