[systemd-commits] src/nspawn

Dave Reisner dreisner at kemper.freedesktop.org
Wed Oct 29 10:43:52 PDT 2014


 src/nspawn/nspawn.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1ab19cb167b32967556eefd8f6d3df0e3de7d67d
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Wed Oct 29 13:32:43 2014 -0400

    nspawn: ignore EEXIST when creating mount point
    
    A combination of commits f3c80515c and 79d80fc14 cause nspawn to
    silently fail with a commandline such as:
    
      # systemd-nspawn -D /build/extra-x86_64 --bind=/usr
    
    strace shows the culprit:
    
      [pid 27868] writev(2, [{"Failed to create mount point /build/extra-x86_64/usr: File exists", 82}, {"\n", 1}], 2) = 83

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index b6d9bc6..d88987a 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -758,7 +758,7 @@ static int mount_binds(const char *dest, char **l, bool ro) {
                  * and char devices. */
                 if (S_ISDIR(source_st.st_mode)) {
                         r = mkdir_label(where, 0755);
-                        if (r < 0) {
+                        if (r < 0 && errno != EEXIST) {
                                 log_error("Failed to create mount point %s: %s", where, strerror(-r));
 
                                 return r;



More information about the systemd-commits mailing list