Skip to content

Commit ff9d325

Browse files
util/managedfile: do not check file creation time in NFS check
Since coreutils 8.31, the file creation time is supported: "stat now prints file creation time when supported by the file system, on GNU Linux systems with glibc >= 2.28 and kernel >= 4.11." [1] labgrid checks the file creation (birth) time locally and remotely. Prior to this change in coreutils' stat, this timestamp was always "0". Since this change, the actual creation timestamp is displayed on the local filesystem. Via NFS however, the creation timestamp is not transferred. This means that on recent kernels and coreutils versions, stat's output locally and remotely differ, although the file is actually the same. This results in an unneeded transfer of the file. In order to fix this, drop the creation (birth) time from the stat call in labgrid altogether. [1] https://lists.gnu.org/archive/html/info-gnu/2019-03/msg00003.html Signed-off-by: Bastian Krause <bst@pengutronix.de>
1 parent 9afa321 commit ff9d325

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

doc/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ available both locally and remotely via the same path:
565565

566566
- check if GNU coreutils stat(1) with option --format exists on local and
567567
remote system
568-
- check if inode number, total size and birth/modification timestamps match
568+
- check if inode number, total size and modification timestamp match
569569
on local and remote system
570570

571571
If this is the case the actual file transfer in ``sync_to_resource`` is

labgrid/util/managedfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _on_nfs(self, conn):
8787

8888
self._on_nfs_cached = False
8989

90-
fmt = "inode=%i,size=%s,birth=%W,modified=%Y"
90+
fmt = "inode=%i,size=%s,modified=%Y"
9191
local = subprocess.run(["stat", "--format", fmt, self.local_path],
9292
stdout=subprocess.PIPE)
9393
if local.returncode != 0:

0 commit comments

Comments
 (0)