Closed
Bug 599200
Opened 14 years ago
Closed 14 years ago
Too much space can be allocated for cache block files
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: michal, Assigned: michal)
Details
Attachments
(1 file, 1 obsolete file)
2.42 KB,
patch
|
Details | Diff | Splinter Review |
Fix in bug 592520 doesn't take into account maximal size of the cache block file.
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #478129 -
Flags: review?(tglek)
Assignee | ||
Updated•14 years ago
|
blocking2.0: --- → ?
Updated•14 years ago
|
Attachment #478129 -
Flags: review?(tglek) → review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Updated•14 years ago
|
blocking2.0: ? → betaN+
Comment 2•14 years ago
|
||
Comment on attachment 478129 [details] [diff] [review] fix >diff --git a/netwerk/cache/nsDiskCacheBlockFile.cpp b/netwerk/cache/nsDiskCacheBlockFile.cpp >+ // maximal file size >+ const PRInt32 maxFileSize = kBitMapBytes * (mBlockSize * 8 + 1); > if (mFileSize < upTo) { > if (upTo > maxPreallocate) { > // grow the file as a multiple of minPreallocate > mFileSize = ((upTo + minPreallocate - 1) / minPreallocate) * minPreallocate; > } else { > // Grow quickly between 1MB to 20MB > if (mFileSize) > while(mFileSize < upTo) > mFileSize *= 2; > mFileSize = PR_MIN(maxPreallocate, PR_MAX(mFileSize, minPreallocate)); > } >- mozilla::fallocate(mFD, mFileSize); >+ mozilla::fallocate(mFD, PR_MIN(mFileSize, maxFileSize)); Nice catch. Nit: might as well put maxFileSize declaration/init within the if block so we don't calculate it when we don't use it.
Assignee | ||
Comment 3•14 years ago
|
||
(In reply to comment #2) > Nit: might as well put maxFileSize declaration/init within the if block so we > don't calculate it when we don't use it. Fixed. I've also changed it so that mFileSize now contains correct value.
Attachment #478129 -
Attachment is obsolete: true
Comment 4•14 years ago
|
||
Checked in. http://hg.mozilla.org/mozilla-central/rev/699b0f8d60e4
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Keywords: checkin-needed
Target Milestone: --- → mozilla2.0b8
Updated•14 years ago
|
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in
before you can comment on or make changes to this bug.
Description
•