Bind mounts can fail to be properly reconnected when PATH_CONNECT is specified. Ensure that when PATH_CONNECT is specified the path has a root. BugLink: http://bugs.launchpad.net/bugs/1319984
Unified · Split
| @@ -141,7 +141,10 @@ static int d_namespace_path(const struct path *path, char *buf, int buflen, · 140 unmodified lines | ||
| 141 | 141 | error = -EACCES; |
| 142 | 142 | if (*res == '/') |
| 143 | 143 | *name = res + 1; |
| 144 | − } | |
| 144 | + } else if (*res != '/') | |
| 145 | + /* CONNECT_PATH with missing root */ | |
| 146 | + error = prepend(name, *name - buf, "/", 1); | |
| 147 | + | |
| 145 | 148 | } |
| 146 | 149 | |
| 147 | 150 | out: |