Skip to content

Commit b1ffafa

Browse files
kbleesgitster
authored andcommitted
Makefile / racy-git.txt: clarify USE_NSEC prerequisites
Signed-off-by: Karsten Blees <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a5fe668 commit b1ffafa

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Documentation/technical/racy-git.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ With a `USE_STDEV` compile-time option, `st_dev` is also
4141
compared, but this is not enabled by default because this member
4242
is not stable on network filesystems. With `USE_NSEC`
4343
compile-time option, `st_mtim.tv_nsec` and `st_ctim.tv_nsec`
44-
members are also compared, but this is not enabled by default
44+
members are also compared. On Linux, this is not enabled by default
4545
because in-core timestamps can have finer granularity than
4646
on-disk timestamps, resulting in meaningless changes when an
4747
inode is evicted from the inode cache. See commit 8ce13b0
4848
of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
4949
([PATCH] Sync in core time granularity with filesystems,
50-
2005-01-04).
50+
2005-01-04). This patch is included in kernel 2.6.11 and newer, but
51+
only fixes the issue for file systems with exactly 1 ns or 1 s
52+
resolution. Other file systems are still broken in current Linux
53+
kernels (e.g. CEPH, CIFS, NTFS, UDF), see
54+
https://lkml.org/lkml/2015/6/9/714
5155

5256
Racy Git
5357
--------

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,11 @@ all::
217217
# as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
218218
#
219219
# Define USE_NSEC below if you want git to care about sub-second file mtimes
220-
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
221-
# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
222-
# randomly break unless your underlying filesystem supports those sub-second
223-
# times (my ext3 doesn't).
220+
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On
221+
# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times
222+
# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git
223+
# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See
224+
# Documentation/technical/racy-git.txt for details.
224225
#
225226
# Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
226227
# "st_ctim"

0 commit comments

Comments
 (0)