Magellan Linux

Annotation of /trunk/systemd/patches/systemd-217-nspawn-ignore-EEXIST-when-creating-mount-point.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2524 - (hide annotations) (download)
Mon Nov 17 13:56:31 2014 UTC (9 years, 7 months ago) by niro
File size: 1230 byte(s)
-upstream fixes
1 niro 2524 From 1ab19cb167b32967556eefd8f6d3df0e3de7d67d Mon Sep 17 00:00:00 2001
2     From: Dave Reisner <dreisner@archlinux.org>
3     Date: Wed, 29 Oct 2014 13:32:43 -0400
4     Subject: [PATCH] nspawn: ignore EEXIST when creating mount point
5    
6     A combination of commits f3c80515c and 79d80fc14 cause nspawn to
7     silently fail with a commandline such as:
8    
9     # systemd-nspawn -D /build/extra-x86_64 --bind=/usr
10    
11     strace shows the culprit:
12    
13     [pid 27868] writev(2, [{"Failed to create mount point /build/extra-x86_64/usr: File exists", 82}, {"\n", 1}], 2) = 83
14     ---
15     src/nspawn/nspawn.c | 2 +-
16     1 file changed, 1 insertion(+), 1 deletion(-)
17    
18     diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
19     index b6d9bc6..d88987a 100644
20     --- a/src/nspawn/nspawn.c
21     +++ b/src/nspawn/nspawn.c
22     @@ -758,7 +758,7 @@ static int mount_binds(const char *dest, char **l, bool ro) {
23     * and char devices. */
24     if (S_ISDIR(source_st.st_mode)) {
25     r = mkdir_label(where, 0755);
26     - if (r < 0) {
27     + if (r < 0 && errno != EEXIST) {
28     log_error("Failed to create mount point %s: %s", where, strerror(-r));
29    
30     return r;
31     --
32     2.1.2
33