|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
From 45c51a0b7f642419bf1f7cd396ab3653dcfd99a9 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
From: Dave Reisner <dreisner@archlinux.org>
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
Date: Wed, 29 Oct 2014 13:32:43 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
Subject: [PATCH] nspawn: ignore EEXIST when creating mount point
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
A combination of commits f3c80515c and 79d80fc14 cause nspawn to
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
silently fail with a commandline such as:
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
# systemd-nspawn -D /build/extra-x86_64 --bind=/usr
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
strace shows the culprit:
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
[pid 27868] writev(2, [{"Failed to create mount point /build/extra-x86_64/usr: File exists", 82}, {"\n", 1}], 2) = 83
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
(cherry picked from commit 1ab19cb167b32967556eefd8f6d3df0e3de7d67d)
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
src/nspawn/nspawn.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
index b6d9bc631c..d88987a580 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
--- a/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+++ b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
@@ -758,7 +758,7 @@ static int mount_binds(const char *dest, char **l, bool ro) {
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
* and char devices. */
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
if (S_ISDIR(source_st.st_mode)) {
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
r = mkdir_label(where, 0755);
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
- if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ if (r < 0 && errno != EEXIST) {
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
log_error("Failed to create mount point %s: %s", where, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
return r;
|