All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites
@ 2015-06-13 20:40 Karsten Blees
  2015-06-15  0:07 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Karsten Blees @ 2015-06-13 20:40 UTC (permalink / raw)
  To: Git List

Signed-off-by: Karsten Blees <blees@dcon.de>
---
Enabling nanosecond file times was recently discussed on the libgit2 project, so
I thought its time to fix the nanosecond issue on Linux. Don't know yet if the
patch will be accepted (and in which kernel version).

Considering that nanosecond file times are still broken for some file systems, it
may be desirable to make this a config option in addition to the compile-time
setting? I.e. only use sub-second file times for up-to-date checks if the config
option is enabled, so that it can be turned off on file systems with flaky
timestamps.

 Documentation/technical/racy-git.txt | 8 ++++++--
 Makefile                             | 9 +++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/Documentation/technical/racy-git.txt b/Documentation/technical/racy-git.txt
index 242a044..89ca173 100644
--- a/Documentation/technical/racy-git.txt
+++ b/Documentation/technical/racy-git.txt
@@ -42,12 +42,16 @@ compared, but this is not enabled by default because this member
 is not stable on network filesystems.  With `USE_NSEC`
 compile-time option, `st_mtim.tv_nsec` and `st_ctim.tv_nsec`
 members are also compared, but this is not enabled by default
-because in-core timestamps can have finer granularity than
+because on Linux, in-core timestamps can have finer granularity than
 on-disk timestamps, resulting in meaningless changes when an
 inode is evicted from the inode cache.  See commit 8ce13b0
 of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
 ([PATCH] Sync in core time granularity with filesystems,
-2005-01-04).
+2005-01-04). This patch is included in kernel 2.6.11 and newer, but
+only fixes the issue for file systems with exactly 1 ns or 1 s
+resolution. Other file systems are still broken in current Linux
+kernels (e.g. CEPH, CIFS, NTFS, UDF), see
+https://lkml.org/lkml/2015/6/9/714
 
 Racy Git
 --------
diff --git a/Makefile b/Makefile
index 54ec511..46d181a 100644
--- a/Makefile
+++ b/Makefile
@@ -217,10 +217,11 @@ all::
 # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
 #
 # Define USE_NSEC below if you want git to care about sub-second file mtimes
-# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
-# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
-# randomly break unless your underlying filesystem supports those sub-second
-# times (my ext3 doesn't).
+# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On
+# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times
+# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git
+# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See
+# Documentation/technical/racy-git.txt for details.
 #
 # Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
 # "st_ctim"
-- 
2.4.3.windows.1.1.g87477f9

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites
  2015-06-13 20:40 [PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites Karsten Blees
@ 2015-06-15  0:07 ` Junio C Hamano
  2015-07-01 19:10   ` [PATCH v2] " Karsten Blees
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2015-06-15  0:07 UTC (permalink / raw)
  To: Karsten Blees; +Cc: Git List

Karsten Blees <karsten.blees@gmail.com> writes:

>  members are also compared, but this is not enabled by default
> -because in-core timestamps can have finer granularity than
> +because on Linux, in-core timestamps can have finer granularity than
>  on-disk timestamps, resulting in meaningless changes when an
>  inode is evicted from the inode cache.  See commit 8ce13b0
>  of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
>  ([PATCH] Sync in core time granularity with filesystems,
> -2005-01-04).

Hmm, the above makes one wonder if on systems other than Linux it
may be better enabled by default.  Perhaps

	members are also compared.  On Linux, this is not enabled by
	default because ...

would make the logic and text flow better?

>  # Define USE_NSEC below if you want git to care about sub-second file mtimes
> -# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
> -# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
> -# randomly break unless your underlying filesystem supports those sub-second
> -# times (my ext3 doesn't).
> +# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On
> +# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times
> +# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git
> +# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See
> +# Documentation/technical/racy-git.txt for details.

This looks good.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] Makefile / racy-git.txt: clarify USE_NSEC prerequisites
  2015-06-15  0:07 ` Junio C Hamano
@ 2015-07-01 19:10   ` Karsten Blees
  0 siblings, 0 replies; 3+ messages in thread
From: Karsten Blees @ 2015-07-01 19:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git List

Signed-off-by: Karsten Blees <blees@dcon.de>
---

...just changed wording as you suggested.

 Documentation/technical/racy-git.txt | 8 ++++++--
 Makefile                             | 9 +++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/Documentation/technical/racy-git.txt b/Documentation/technical/racy-git.txt
index 242a044..4a8be4d 100644
--- a/Documentation/technical/racy-git.txt
+++ b/Documentation/technical/racy-git.txt
@@ -41,13 +41,17 @@ With a `USE_STDEV` compile-time option, `st_dev` is also
 compared, but this is not enabled by default because this member
 is not stable on network filesystems.  With `USE_NSEC`
 compile-time option, `st_mtim.tv_nsec` and `st_ctim.tv_nsec`
-members are also compared, but this is not enabled by default
+members are also compared. On Linux, this is not enabled by default
 because in-core timestamps can have finer granularity than
 on-disk timestamps, resulting in meaningless changes when an
 inode is evicted from the inode cache.  See commit 8ce13b0
 of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
 ([PATCH] Sync in core time granularity with filesystems,
-2005-01-04).
+2005-01-04). This patch is included in kernel 2.6.11 and newer, but
+only fixes the issue for file systems with exactly 1 ns or 1 s
+resolution. Other file systems are still broken in current Linux
+kernels (e.g. CEPH, CIFS, NTFS, UDF), see
+https://lkml.org/lkml/2015/6/9/714
 
 Racy Git
 --------
diff --git a/Makefile b/Makefile
index 54ec511..46d181a 100644
--- a/Makefile
+++ b/Makefile
@@ -217,10 +217,11 @@ all::
 # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
 #
 # Define USE_NSEC below if you want git to care about sub-second file mtimes
-# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
-# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
-# randomly break unless your underlying filesystem supports those sub-second
-# times (my ext3 doesn't).
+# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On
+# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times
+# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git
+# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See
+# Documentation/technical/racy-git.txt for details.
 #
 # Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
 # "st_ctim"
-- 
2.4.3.windows.1.1.g87477f9

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-01 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-13 20:40 [PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites Karsten Blees
2015-06-15  0:07 ` Junio C Hamano
2015-07-01 19:10   ` [PATCH v2] " Karsten Blees

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.