This is an archive of the discontinued LLVM Phabricator instance.

LTO: Create temporary cache files in the cache directory instead of $TMPDIR.
ClosedPublic

Authored by pcc on Mar 16 2017, 11:14 AM.

Details

Summary

This fixes a race condition where another linker process can observe a
partially written file if we copy it from another file system, and allows
the link to be independent of the amount of free disk space in $TMPDIR.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Mar 16 2017, 11:14 AM
mehdi_amini accepted this revision.Mar 16 2017, 11:19 AM

That's nice! LGTM.

I wonder though if we shouldn't have the cache pruning take a "blacklist" of patterns and ignore these files. I wouldn't want one linker process to delete temporary files from another one (Unlikely to happen I guess since LRU though).

This revision is now accepted and ready to land.Mar 16 2017, 11:19 AM
pcc added a comment.Mar 16 2017, 11:31 AM

That's nice! LGTM.

I wonder though if we shouldn't have the cache pruning take a "blacklist" of patterns and ignore these files. I wouldn't want one linker process to delete temporary files from another one (Unlikely to happen I guess since LRU though).

Probably the simplest thing we could do to avoid this problem is to create the temporaries in a subdirectory of the cache directory, and have the pruning ignore subdirectories. I agree with you that this is unlikely though.

This revision was automatically updated to reflect the committed changes.