[PATCH] D92686: [Support] Add workaround for a bug in fuse-overlayfs
Tom Stellard via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 4 13:33:19 PST 2020
tstellar created this revision.
Herald added subscribers: dexonsmith, sunfish, hiraditya.
tstellar requested review of this revision.
Herald added a subscriber: aheejin.
Herald added a project: LLVM.
This fixes the following lit tests when running in a podman container
using fuse-overlayfs:
lld :: COFF/lto-cache.ll
lld :: ELF/lto/cache.ll
lld :: wasm/lto/cache.ll
Fixes: PR48380
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D92686
Files:
llvm/lib/Support/Unix/Path.inc
Index: llvm/lib/Support/Unix/Path.inc
===================================================================
--- llvm/lib/Support/Unix/Path.inc
+++ llvm/lib/Support/Unix/Path.inc
@@ -315,7 +315,19 @@
}
TimePoint<> basic_file_status::getLastAccessedTime() const {
- return toTimePoint(fs_st_atime, fs_st_atime_nsec);
+ // There is a bug in fuse-overlayfs, which is a filesystem mostly used by
+ // containers, which causes the value of atime to be incorrect in some
+ // specific scenarios. The value of mtime is not affected, so we can
+ // workaround this by returning mtime if its newer than atime.
+ // https://github.com/containers/fuse-overlayfs/issues/259
+ //
+ // This should be a no-op on all other file systems, since atime should
+ // always be as new or newer than mtime.
+ auto ATime = toTimePoint(fs_st_atime, fs_st_atime_nsec);
+ auto MTime = getLastModificationTime();
+ if (MTime > ATime)
+ return MTime;
+ return ATime;
}
TimePoint<> basic_file_status::getLastModificationTime() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92686.309638.patch
Type: text/x-patch
Size: 1027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201204/cc1e2fc6/attachment.bin>
More information about the llvm-commits
mailing list