chiark / gitweb /
remove MS_* which can not be combined with current kernel code
authorKay Sievers <kay@vrfy.org>
Wed, 18 Apr 2012 11:37:45 +0000 (13:37 +0200)
committerKay Sievers <kay@vrfy.org>
Wed, 18 Apr 2012 11:37:45 +0000 (13:37 +0200)
MS_BIND|MS_MOVE can not be combined:
  do_mount()
    else if (flags & MS_BIND)
      do_loopback(&path, dev_name, flags & MS_REC);
    [...]
    else if (flags & MS_MOVE)
      do_move_mount(&path, dev_name);

MS_REMOUNT|MS_UNBINDABLE can not be combined:
  do_mount()
    if (flags & MS_REMOUNT)
      do_remount(&path, flags & ~MS_REMOUNT, mnt_flags, data_page);
    [...]
    else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
      do_change_type(&path, flags);

src/core/namespace.c
src/nspawn/nspawn.c

index da555cd..7ac6b38 100644 (file)
@@ -167,7 +167,7 @@ static int apply_mount(Path *p, const char *root_dir, const char *inaccessible_d
 
                 /* Avoid exponential growth of trees */
                 if (r >= 0 && path_equal(p->path, "/"))
-                        r = mount(NULL, where, NULL, MS_REMOUNT|MS_BIND|MS_UNBINDABLE|flags, NULL);
+                        r = mount(NULL, where, NULL, MS_REMOUNT|MS_BIND|flags, NULL);
 
                 if (r < 0) {
                         r = -errno;
index ce727b6..90c8b94 100644 (file)
@@ -928,7 +928,7 @@ int main(int argc, char *argv[]) {
                     dup2(STDIN_FILENO, STDERR_FILENO) != STDERR_FILENO)
                         goto child_fail;
 
-                if (mount(arg_directory, "/", "bind", MS_BIND|MS_MOVE, NULL) < 0) {
+                if (mount(arg_directory, "/", "bind", MS_BIND, NULL) < 0) {
                         log_error("mount(MS_MOVE) failed: %m");
                         goto child_fail;
                 }