{"thread":{"id":"39623","subject":"[PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites","startedAt":"2015-06-13T20:40:06Z","lastAt":"2015-07-01T19:10:52Z","messageCount":3,"participants":["Karsten Blees","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"263765","messageId":"557C9526.6080000@gmail.com","threadId":"39623","inReplyTo":null,"subject":"[PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites","fromName":"Karsten Blees","fromEmail":"karsten.blees@gmail.com","sentAt":"2015-06-13T20:40:06Z","receivedAt":"2015-06-13T20:40:06Z","isPatch":true,"sender":{"key":"karsten.blees@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1111200?v=4"},"body":"Signed-off-by: Karsten Blees <blees@dcon.de>\n---\nEnabling nanosecond file times was recently discussed on the libgit2 project, so\nI thought its time to fix the nanosecond issue on Linux. Don't know yet if the\npatch will be accepted (and in which kernel version).\n\nConsidering that nanosecond file times are still broken for some file systems, it\nmay be desirable to make this a config option in addition to the compile-time\nsetting? I.e. only use sub-second file times for up-to-date checks if the config\noption is enabled, so that it can be turned off on file systems with flaky\ntimestamps.\n\n Documentation/technical/racy-git.txt | 8 ++++++--\n Makefile                             | 9 +++++----\n 2 files changed, 11 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/technical/racy-git.txt b/Documentation/technical/racy-git.txt\nindex 242a044..89ca173 100644\n--- a/Documentation/technical/racy-git.txt\n+++ b/Documentation/technical/racy-git.txt\n@@ -42,12 +42,16 @@ compared, but this is not enabled by default because this member\n is not stable on network filesystems.  With `USE_NSEC`\n compile-time option, `st_mtim.tv_nsec` and `st_ctim.tv_nsec`\n members are also compared, but this is not enabled by default\n-because in-core timestamps can have finer granularity than\n+because on Linux, in-core timestamps can have finer granularity than\n on-disk timestamps, resulting in meaningless changes when an\n inode is evicted from the inode cache.  See commit 8ce13b0\n of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git\n ([PATCH] Sync in core time granularity with filesystems,\n-2005-01-04).\n+2005-01-04). This patch is included in kernel 2.6.11 and newer, but\n+only fixes the issue for file systems with exactly 1 ns or 1 s\n+resolution. Other file systems are still broken in current Linux\n+kernels (e.g. CEPH, CIFS, NTFS, UDF), see\n+https://lkml.org/lkml/2015/6/9/714\n \n Racy Git\n --------\ndiff --git a/Makefile b/Makefile\nindex 54ec511..46d181a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -217,10 +217,11 @@ all::\n # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)\n #\n # Define USE_NSEC below if you want git to care about sub-second file mtimes\n-# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and\n-# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely\n-# randomly break unless your underlying filesystem supports those sub-second\n-# times (my ext3 doesn't).\n+# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On\n+# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times\n+# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git\n+# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See\n+# Documentation/technical/racy-git.txt for details.\n #\n # Define USE_ST_TIMESPEC if your \"struct stat\" uses \"st_ctimespec\" instead of\n # \"st_ctim\"\n-- \n2.4.3.windows.1.1.g87477f9\n"},{"id":"263832","messageId":"xmqqr3pdltqu.fsf@gitster.dls.corp.google.com","threadId":"39623","inReplyTo":"557C9526.6080000@gmail.com","subject":"Re: [PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-15T00:07:05Z","receivedAt":"2015-06-15T00:07:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Karsten Blees <karsten.blees@gmail.com> writes:\n\n>  members are also compared, but this is not enabled by default\n> -because in-core timestamps can have finer granularity than\n> +because on Linux, in-core timestamps can have finer granularity than\n>  on-disk timestamps, resulting in meaningless changes when an\n>  inode is evicted from the inode cache.  See commit 8ce13b0\n>  of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git\n>  ([PATCH] Sync in core time granularity with filesystems,\n> -2005-01-04).\n\nHmm, the above makes one wonder if on systems other than Linux it\nmay be better enabled by default.  Perhaps\n\n\tmembers are also compared.  On Linux, this is not enabled by\n\tdefault because ...\n\nwould make the logic and text flow better?\n\n>  # Define USE_NSEC below if you want git to care about sub-second file mtimes\n> -# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and\n> -# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely\n> -# randomly break unless your underlying filesystem supports those sub-second\n> -# times (my ext3 doesn't).\n> +# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On\n> +# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times\n> +# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git\n> +# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See\n> +# Documentation/technical/racy-git.txt for details.\n\nThis looks good.\n"},{"id":"265357","messageId":"55943B3C.9050200@gmail.com","threadId":"39623","inReplyTo":"xmqqr3pdltqu.fsf@gitster.dls.corp.google.com","subject":"[PATCH v2] Makefile / racy-git.txt: clarify USE_NSEC prerequisites","fromName":"Karsten Blees","fromEmail":"karsten.blees@gmail.com","sentAt":"2015-07-01T19:10:52Z","receivedAt":"2015-07-01T19:10:52Z","isPatch":true,"sender":{"key":"karsten.blees@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1111200?v=4"},"body":"Signed-off-by: Karsten Blees <blees@dcon.de>\n---\n\n...just changed wording as you suggested.\n\n Documentation/technical/racy-git.txt | 8 ++++++--\n Makefile                             | 9 +++++----\n 2 files changed, 11 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/technical/racy-git.txt b/Documentation/technical/racy-git.txt\nindex 242a044..4a8be4d 100644\n--- a/Documentation/technical/racy-git.txt\n+++ b/Documentation/technical/racy-git.txt\n@@ -41,13 +41,17 @@ With a `USE_STDEV` compile-time option, `st_dev` is also\n compared, but this is not enabled by default because this member\n is not stable on network filesystems.  With `USE_NSEC`\n compile-time option, `st_mtim.tv_nsec` and `st_ctim.tv_nsec`\n-members are also compared, but this is not enabled by default\n+members are also compared. On Linux, this is not enabled by default\n because in-core timestamps can have finer granularity than\n on-disk timestamps, resulting in meaningless changes when an\n inode is evicted from the inode cache.  See commit 8ce13b0\n of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git\n ([PATCH] Sync in core time granularity with filesystems,\n-2005-01-04).\n+2005-01-04). This patch is included in kernel 2.6.11 and newer, but\n+only fixes the issue for file systems with exactly 1 ns or 1 s\n+resolution. Other file systems are still broken in current Linux\n+kernels (e.g. CEPH, CIFS, NTFS, UDF), see\n+https://lkml.org/lkml/2015/6/9/714\n \n Racy Git\n --------\ndiff --git a/Makefile b/Makefile\nindex 54ec511..46d181a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -217,10 +217,11 @@ all::\n # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)\n #\n # Define USE_NSEC below if you want git to care about sub-second file mtimes\n-# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and\n-# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely\n-# randomly break unless your underlying filesystem supports those sub-second\n-# times (my ext3 doesn't).\n+# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On\n+# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times\n+# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git\n+# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See\n+# Documentation/technical/racy-git.txt for details.\n #\n # Define USE_ST_TIMESPEC if your \"struct stat\" uses \"st_ctimespec\" instead of\n # \"st_ctim\"\n-- \n2.4.3.windows.1.1.g87477f9\n"}]}