From: Linus Torvalds Date: Thu, 09 Jul 2009 20:56:17 GMT Subject: Re: [PATCH 7/3] Make index preloading check the whole path to the file Message-ID: In-Reply-To: Ok, with these patches, the strace of the index preload looks very clean, and has the required tests for the directory components too: ... 26504 lstat("connect.c", {st_mode=S_IFREG|0664, st_size=14312, ...}) = 0 26504 lstat("contrib", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 26504 lstat("contrib/README", {st_mode=S_IFREG|0664, st_size=2113, ...}) = 0 26504 lstat("contrib/blameview", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 26504 lstat("contrib/blameview/blameview.perl", {st_mode=S_IFREG|0775, st_size=3776, ...}) = 0 ... ie now it actualyl verifies that the directories leading up to filenames are really directories by doing lstat() on them. And the symlink cache means that it doesn't do it for every single pathname, only for the first lookup per thread and directory. Maybe Kjetil wants to check the changes, but quite frankly, it looked pretty trivial to make that whole has_symlink_leading_path() be thread-safe. Linus