diff options
author | Antonin Kral <a.kral@bobek.cz> | 2012-05-10 06:57:57 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2012-05-10 06:57:57 +0200 |
commit | 8813daaab256108f7aa6300875e8562d031f2c2f (patch) | |
tree | 06daade9022f76b2775d23f4613817365a2ded99 /db/pdfile.cpp | |
parent | d72a59184a3d51b17b30ed20fe656421bd4d2248 (diff) | |
parent | 61619b3142c1de8f60f91964ff2656054d4f11a6 (diff) | |
download | mongodb-8813daaab256108f7aa6300875e8562d031f2c2f.tar.gz |
Merge tag 'upstream/2.0.5'
Upstream version 2.0.5
Diffstat (limited to 'db/pdfile.cpp')
-rw-r--r-- | db/pdfile.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp index ac7731a..60914d9 100644 --- a/db/pdfile.cpp +++ b/db/pdfile.cpp @@ -434,6 +434,7 @@ namespace mongo { } Extent* MongoDataFile::createExtent(const char *ns, int approxSize, bool newCapped, int loops) { + assert( approxSize <= Extent::maxSize() ); { // make sizes align with VM page size int newSize = (approxSize + 0xfff) & 0xfffff000; @@ -491,6 +492,10 @@ namespace mongo { // overflowed high = max(approxSize, Extent::maxSize()); } + if ( high <= Extent::minSize() ) { + // the minimum extent size is 4097 + high = Extent::minSize() + 1; + } int n = 0; Extent *best = 0; int bestDiff = 0x7fffffff; |