Commit 68c152ef by Serge Hallyn Committed by Stéphane Graber

setup_mount_entries: ignore mount failure if 'optional'

If 'optional' is in the mount options, then avoid failure in mount(). Experiments suggest we could just do this checking data at mount_entry(), but that feels less proper than using hasmntopt() against the mntent. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 5e1e7aaf
......@@ -1502,6 +1502,9 @@ static inline int mount_entry_on_systemfs(struct mntent *mntent)
ret = mount_entry(mntent->mnt_fsname, mntent->mnt_dir,
mntent->mnt_type, mntflags, mntdata);
if (hasmntopt(mntent, "optional") != NULL)
ret = 0;
free(mntdata);
return ret;
......@@ -1556,6 +1559,9 @@ skipabs:
ret = mount_entry(mntent->mnt_fsname, path, mntent->mnt_type,
mntflags, mntdata);
if (hasmntopt(mntent, "optional") != NULL)
ret = 0;
out:
free(mntdata);
return ret;
......@@ -1584,6 +1590,9 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
ret = mount_entry(mntent->mnt_fsname, path, mntent->mnt_type,
mntflags, mntdata);
if (hasmntopt(mntent, "optional") != NULL)
ret = 0;
free(mntdata);
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment