summaryrefslogtreecommitdiff
path: root/doc/bugs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-20 16:58:48 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-20 17:09:24 -0400
commitc7e67aa29183c7fe7bb14b909cf953a89c531b08 (patch)
treee63f341fb51375faf9a0928af00703bcef584306 /doc/bugs
parent68c8b9b7592a7c407bdd6a0fe8b5f49241118926 (diff)
add getFileSize, which can get the real size of a large file on Windows
Avoid using fileSize which maxes out at just 2 gb on Windows. Instead, use hFileSize, which doesn't have a bounded size. Fixes support for files > 2 gb on Windows. Note that the InodeCache code only needs to compare a file size, so it doesn't matter it the file size wraps. So it has been left as-is. This was necessary both to avoid invalidating existing inode caches, and because the code passed FileStatus around and would have become more expensive if it called getFileSize. This commit was sponsored by Christian Dietrich.
Diffstat (limited to 'doc/bugs')
-rw-r--r--doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file.mdwn2
-rw-r--r--doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file/comment_1_cb9e9dada7baf4e48725a9483b3b448a._comment25
2 files changed, 27 insertions, 0 deletions
diff --git a/doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file.mdwn b/doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file.mdwn
index 773d452f6..21c7af19b 100644
--- a/doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file.mdwn
+++ b/doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file.mdwn
@@ -56,3 +56,5 @@ git-annex: sync: 1 failed
# End of transcript or log.
"""]]
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file/comment_1_cb9e9dada7baf4e48725a9483b3b448a._comment b/doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file/comment_1_cb9e9dada7baf4e48725a9483b3b448a._comment
new file mode 100644
index 000000000..42acf9f64
--- /dev/null
+++ b/doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file/comment_1_cb9e9dada7baf4e48725a9483b3b448a._comment
@@ -0,0 +1,25 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2015-01-20T19:41:44Z"
+ content="""
+In my own test, I made a 10 gb file, and the key git-annex came up with had
+a size of -2147483648 which is clearly screwed up.. But that's what
+getFileStatus reports the size as. This was in an 32 bit XP VM.
+
+Hmm, unix-compat's getFileStatus calls getFileSize, which yields a
+FileOffset. The maxBound of that on linux is a nice large
+9223372036854775807, but on Windows, it appears to be 2147483647.
+
+Compare with using hFileSize, which yields an Integer. So,
+getFileSize and fileSize are unsafe on Windows due to FileOffset being so
+small on Windows.
+
+I have now corrected all places in git-annex that used the unsafe fileSize.
+It will behave correctly on Windows now.
+
+However, if you still have the repo with the big file, it's key still has
+the wrong size. To fix, you can "git annex unannex" the file, and then "git
+annex add" it back, after upgrading to the current daily build, or the next
+release of git-annex.
+"""]]