File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -827,12 +827,20 @@ fn ensure_var() -> Result<()> {
827
827
pub ( crate ) fn propagate_tmp_mounts_to_host ( ) -> Result < ( ) > {
828
828
// Point our /tmp and /var/tmp at the host, via the /proc/1/root magic link
829
829
for path in [ "/tmp" , "/var/tmp" ] . map ( Utf8Path :: new) {
830
+ if path. try_exists ( ) ? {
831
+ let st = rustix:: fs:: statfs ( path. as_std_path ( ) ) . context ( path) ?;
832
+ if st. f_type != libc:: OVERLAYFS_SUPER_MAGIC {
833
+ tracing:: trace!( "Already have {path} with f_type={}" , st. f_type) ;
834
+ continue ;
835
+ }
836
+ }
830
837
let target = format ! ( "/proc/1/root/{path}" ) ;
831
838
let tmp = format ! ( "{path}.tmp" ) ;
832
839
// Ensure idempotence in case we're re-executed
833
840
if path. is_symlink ( ) {
834
841
continue ;
835
842
}
843
+ tracing:: debug!( "Retargeting {path} to host" ) ;
836
844
if path. try_exists ( ) ? {
837
845
std:: os:: unix:: fs:: symlink ( & target, & tmp)
838
846
. with_context ( || format ! ( "Symlinking {target} to {tmp}" ) ) ?;
You can’t perform that action at this time.
0 commit comments