Closed Bug 541660 Opened 10 years ago Closed 10 years ago

test_largeOfflineStore.js: Detect and exit early with non-NTFS volumes, and otherwise mark the inbox file as sparse on Windows

Categories

(MailNews Core :: Testing Infrastructure, defect)

x86
Windows 7
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.1b1

People

(Reporter: rain1, Assigned: rain1)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch patch, v1 (obsolete) — Splinter Review
FAT32 doesn't work with files above 4 GB, so we need to detect early and exit there.

Also, given that almost the entire file is empty, it seems like a waste to allocate space for it, so mark the file as sparse and the first 4 GB + change as a sparse region.

This doesn't need to be done on Linux, as the file system doesn't allocate space for untouched areas [1, 2]. On OS X, HFS+ doesn't support sparse files [1], so we still check for free space there -- apparently UFS does support sparse files, but I don't have OS X so I can't write a native code helper.

[1] http://stackoverflow.com/questions/186077/how-do-i-create-a-sparse-file-programmatically-in-c-on-mac-os-x

[2] http://www.win.tue.nl/~aeb/linux/lk/lk-6.html#ss6.2
Attachment #423138 - Flags: review?(bugzilla)
MSDN docs for sparse file operations: <http://msdn.microsoft.com/en-us/library/aa365566(VS.85).aspx>
Attached patch patch, v1.001 (obsolete) — Splinter Review
Removed a dump statement and tweaked the position of an opening brace.
Attachment #423138 - Attachment is obsolete: true
Attachment #423139 - Flags: review?(bugzilla)
Attachment #423138 - Flags: review?(bugzilla)
We're eventually going to want something similar when we allow pop mailboxes > 4GB, so some or all of this might want to be in a shared place.
Attached patch patch, v2Splinter Review
Yeah, I think I should have done that in the first place.
Attachment #423139 - Attachment is obsolete: true
Attachment #423148 - Flags: review?(bugzilla)
Attachment #423139 - Flags: review?(bugzilla)
Hm, I guess this'll need an ifdef ENABLE_TESTS around it in the makefile?
Comment on attachment 423148 [details] [diff] [review]
patch, v2

>@@ -51,16 +51,17 @@ PARALLEL_DIRS	+= \
...
>+	test \

This should be in a separate ifdef ENABLE_TESTS check.

>+    // XXX This needs to be fixed to use runw once it lands
>+    helperProc.run(true, args, args.length);

Nit: please include the bug number for this.
Attachment #423148 - Flags: review?(bugzilla) → review+
Depends on: 411511
http://hg.mozilla.org/comm-central/rev/507ca7dafb29
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.1b1
Depends on: 559681
You need to log in before you can comment on or make changes to this bug.