Skip to content

Commit

Permalink
Merge "Retry mounts on -EAGAIN"
Browse files Browse the repository at this point in the history
am: ccb06c7

Change-Id: I7f8609724b7bab07892401fbb102228058606d55
  • Loading branch information
drosen-google authored and android-build-merger committed Jan 17, 2019
2 parents befe386 + ccb06c7 commit 4a8d70c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions fs_mgr/fs_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,17 @@ static int __mount(const std::string& source, const std::string& target, const F
mkdir(target.c_str(), 0755);
errno = 0;
unsigned long mountflags = entry.flags;
int ret = mount(source.c_str(), target.c_str(), entry.fs_type.c_str(), mountflags,
int ret = 0;
int save_errno = 0;
do {
if (save_errno == EAGAIN) {
PINFO << "Retrying mount (source=" << source << ",target=" << target
<< ",type=" << entry.fs_type << ")=" << ret << "(" << save_errno << ")";
}
ret = mount(source.c_str(), target.c_str(), entry.fs_type.c_str(), mountflags,
entry.fs_options.c_str());
int save_errno = errno;
save_errno = errno;
} while (ret && save_errno == EAGAIN);
const char* target_missing = "";
const char* source_missing = "";
if (save_errno == ENOENT) {
Expand Down

0 comments on commit 4a8d70c

Please sign in to comment.