Spawn "mount" on branches when waiting for mounts enabled
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run

This commit is contained in:
trapexit 2025-06-08 15:09:47 -05:00 • committed by GitHub
parent 23824eaeb4
commit 1b167d34d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 2235 additions and 48 deletions

View file

@ -19,6 +19,7 @@
#include "fs_wait_for_mount.hpp"
#include "syslog.hpp"
#include "fs_mount.hpp"
#include "fs_exists.hpp"
#include "fs_lgetxattr.hpp"
#include "fs_lstat.hpp"
@ -123,13 +124,13 @@ _wait_for_mount(const struct stat &src_st_,
for(const auto &path : successes)
{
tgt_paths.erase(path);
SysLog::info("{} is mounted",path.string());
SysLog::info("{} is ready",path.string());
}
if(first_loop)
{
for(const auto &path : failures)
SysLog::notice("{} is not mounted, waiting",path.string());
SysLog::notice("{} is not ready, waiting",path.string());
first_loop = false;
}
@ -138,7 +139,7 @@ _wait_for_mount(const struct stat &src_st_,
}
for(auto const &path : failures)
SysLog::notice("{} not mounted within timeout",path.string());
SysLog::notice("{} not ready within timeout",path.string());
return failures.size();
}
@ -157,5 +158,18 @@ fs::wait_for_mount(const fs::Path &src_path_,
src_path_.string(),
strerror(errno));
for(auto &tgt_path : tgt_paths_)
{
int rv;
if(_branch_is_mounted(src_st,tgt_path))
continue;
rv = fs::mount(tgt_path);
SysLog::notice("mount {}: {}",
tgt_path.string(),
((rv == 0) ? "success" : "fail"));
}
return ::_wait_for_mount(src_st,tgt_paths_,timeout_);
}