diff -Nru mongodb-2.4.9/debian/changelog mongodb-2.4.9/debian/changelog --- mongodb-2.4.9/debian/changelog 2014-03-06 11:08:59.000000000 +0000 +++ mongodb-2.4.9/debian/changelog 2014-03-27 07:20:15.000000000 +0000 @@ -1,3 +1,9 @@ +mongodb (1:2.4.9-1ubuntu2) trusty; urgency=medium + + * d/p/0099-Pagesize-hacks.patch: Apply some hacks for non-4k pages. + + -- Adam Conrad Thu, 27 Mar 2014 01:20:08 -0600 + mongodb (1:2.4.9-1ubuntu1) trusty; urgency=medium * Enable ppc64el build (LP: #1288633): diff -Nru mongodb-2.4.9/debian/patches/0099-Pagesize-hacks.patch mongodb-2.4.9/debian/patches/0099-Pagesize-hacks.patch --- mongodb-2.4.9/debian/patches/0099-Pagesize-hacks.patch 1970-01-01 00:00:00.000000000 +0000 +++ mongodb-2.4.9/debian/patches/0099-Pagesize-hacks.patch 2014-03-27 07:19:40.000000000 +0000 @@ -0,0 +1,48 @@ +diff --git a/src/mongo/util/logfile.cpp b/src/mongo/util/logfile.cpp +index fa53690..28562b2 100644 +--- a/src/mongo/util/logfile.cpp ++++ b/src/mongo/util/logfile.cpp +@@ -26,6 +26,7 @@ + #include "mongo/util/startup_test.h" + #include "mongo/util/text.h" + ++#define PAGESIZE sysconf(_SC_PAGESIZE) + + using namespace mongoutils; + +@@ -36,16 +41,16 @@ namespace mongo { + if( 0 && debug ) { + try { + LogFile f("logfile_test"); +- void *p = malloc(16384); ++ void *p = malloc(4*PAGESIZE); + char *buf = (char*) p; +- buf += 4095; ++ buf += PAGESIZE - 1; + buf = (char*) (((size_t)buf)&(~0xfff)); + memset(buf, 'z', 8192); +- buf[8190] = '\n'; +- buf[8191] = 'B'; ++ buf[2 * PAGESIZE - 2] = '\n'; ++ buf[2 * PAGESIZE - 1] = 'B'; + buf[0] = 'A'; +- f.synchronousAppend(buf, 8192); +- f.synchronousAppend(buf, 8192); ++ f.synchronousAppend(buf, 2 * PAGESIZE); ++ f.synchronousAppend(buf, 2 * PAGESIZE); + free(p); + } + catch(DBException& e ) { +@@ -226,7 +231,11 @@ namespace mongo { + + fassert( 16144, charsToWrite >= 0 ); + fassert( 16142, _fd >= 0 ); +- fassert( 16143, reinterpret_cast( buf ) % g_minOSPageSizeBytes == 0 ); // aligned ++ ++// Disabling alignment test on PPC64 due to a 64kB page size on PPC64 instead of 4kB on x86 ++#ifndef __PPC64__ ++ fassert( 16143, reinterpret_cast( buf ) % g_minOSPageSizeBytes == 0 ); // aligned ++#endif + + #ifdef POSIX_FADV_DONTNEED + const off_t pos = lseek(_fd, 0, SEEK_CUR); // doesn't actually seek, just get current position diff -Nru mongodb-2.4.9/debian/patches/series mongodb-2.4.9/debian/patches/series --- mongodb-2.4.9/debian/patches/series 2014-03-06 09:20:12.000000000 +0000 +++ mongodb-2.4.9/debian/patches/series 2014-03-27 07:19:51.000000000 +0000 @@ -13,3 +13,4 @@ 0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch 0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch 0004-Support-ppc64el-builds.patch +0099-Pagesize-hacks.patch