Re: [PATCH v3 0/8] Fix GIT_CEILING_DIRECTORIES that contain symlinks
From: Michael Haggerty <hidden>
Date: 2016-06-15 22:55:05
On 10/21/2012 08:51 AM, Junio C Hamano wrote:
Michael Haggerty [off-list ref] writes:quoted
This patch series has the side effect that all of the directories listed in GIT_CEILING_DIRECTORIES are accessed *unconditionally* to resolve any symlinks that are present in their paths. It is admittedly odd that a feature intended to avoid accessing expensive directories would now *intentionally* access directories near the expensive ones. In the above scenario this shouldn't be a problem, because /home would be the directory listed in GIT_CEILING_DIRECTORIES, and accessing /home itself shouldn't be expensive.Interesting observation. In the last sentence, "accessing /home" does not exactly mean accessing /home, but accessing / to learn about "home" in it, no?
This is the extra overhead on my system for using
GIT_CEILING_DIRECTORIES=/home:
stat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getcwd("/home/mhagger", 1024) = 14
chdir("/home") = 0
getcwd("/home", 4096) = 6
lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
chdir("/home/mhagger") = 0
If I use GIT_CEILING_DIRECTORIES=/dev/shm, which is a symlink to
/run/shm on my system, the overhead is comparable:
stat("/dev/shm", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=200, ...}) = 0
getcwd("/home/mhagger", 1024) = 14
chdir("/dev/shm") = 0
getcwd("/run/shm", 4096) = 9
lstat("/run/shm", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=200, ...}) = 0
chdir("/home/mhagger") = 0
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/