From bbfe3c75fcbf70a742ac3f0cafad262f3e9d310a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Feb 2013 17:13:45 -0400 Subject: blog for the day --- doc/design/assistant/android.mdwn | 11 +++++++ .../blog/day_188__crippled_filesystem_support.mdwn | 37 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 doc/design/assistant/blog/day_188__crippled_filesystem_support.mdwn (limited to 'doc/design') diff --git a/doc/design/assistant/android.mdwn b/doc/design/assistant/android.mdwn index c972b5529..cb82a40dc 100644 --- a/doc/design/assistant/android.mdwn +++ b/doc/design/assistant/android.mdwn @@ -17,3 +17,14 @@ transfers when not on wifi. This may need to be configurable. Due to use of the FAT filesystem, which doesn't do symlinks, [[desymlink]] is probably needed for at least older Android devices that have SD cards. + +## TODO + +* In crippled filesystem mode, files are not hardlinked to a quarantine + directory, so the assistant's use of lsof on that directory won't work. + Instead, it should run lsof on the whole repository, and ignore other + stuff. (Not really much slower even in a large repo, according to + benchmarks.) +* rsync backend creates hard links +* migrate creates hard links between old and new keys +* avoid all symlink creation in crippled filesystem + direct mode diff --git a/doc/design/assistant/blog/day_188__crippled_filesystem_support.mdwn b/doc/design/assistant/blog/day_188__crippled_filesystem_support.mdwn new file mode 100644 index 000000000..48f6069d4 --- /dev/null +++ b/doc/design/assistant/blog/day_188__crippled_filesystem_support.mdwn @@ -0,0 +1,37 @@ +There are at least three problems with using git-annex +on `/sdcard` on Android, or on a FAT filesystem, or on (to a first +approximation) Windows: + +1. symlinks +2. hard links +3. unix permissions + +So, I've added an `annex.crippledfilesystem` setting. `git annex init` now +probes to see if all three are supported, and if not, enables that, as well +as direct mode. + +In crippled filesystem mode, all the permissions settings are skipped. +Most of them are only used to lock down content in the annex in indirect +mode anyway, so no great loss. + +There are several uses of hard links, most of which can be dealt with by +making copies. The one use of permissions and hard links I absolutely +needed to deal with was that they're used to lock down a file as it's being +ingested into the annex. That can't be done on crippled filesystems, so I +made it instead check the metadata of the file before and after to detect +if it changed, the same way direct mode detects when files are modified. +This is likely better than the old method anyway. + +The other reason files are hardlinked while they're being ingested is that +this allows running lsof on a single directory of files that are in the +process of being added, to detect if anything has them open for write. +I still need to adjust the lsof check to work in crippled filesystem mode. +It seems this won't make it much slower to run lsof on the whole repository. + +At this point, I can use git-annex with a repository on `/sdcard` or a FAT +filesystem, and at least `git annex add` works. + +Still several things on the TODO list before crippled filesystem mode is +complete. The only one I'm scared about is making `git merge` do something +sane when it wants to merge two trees full of symlinks, and the filesystem +doesn't let it create a symlink.. -- cgit v1.2.3