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: Serge Hallyn <serge.hal...@ubuntu.com>
---
 src/lxc/conf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 65cc2dc..63f5567 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -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;
-- 
1.8.0


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to