]> Git Repo - linux.git/commitdiff
Merge tag 'filelock-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton...
authorLinus Torvalds <[email protected]>
Wed, 18 Sep 2019 20:41:01 +0000 (13:41 -0700)
committerLinus Torvalds <[email protected]>
Wed, 18 Sep 2019 20:41:01 +0000 (13:41 -0700)
Pull file locking updates from Jeff Layton:
 "Just a couple of minor bugfixes, a revision to a tracepoint to account
  for some earlier changes to the internals, and a patch to add a
  pr_warn message when someone tries to mount a filesystem with '-o
  mand' on a kernel that has that support disabled"

* tag 'filelock-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
  locks: fix a memory leak bug in __break_lease()
  locks: print a warning when mount fails due to lack of "mand" support
  locks: Fix procfs output for file leases
  locks: revise generic_add_lease tracepoint

1  2 
fs/namespace.c

diff --combined fs/namespace.c
index 81edb7e7ddfda8840e233fd2ead048b3d35377d0,602bd78ba572e5ff13f9a7dedbc2734696b56cb4..227f7b34303465a2621497524dece91038267b23
@@@ -1463,6 -1463,7 +1463,6 @@@ static void umount_tree(struct mount *m
                        p->mnt.mnt_flags |= MNT_SYNC_UMOUNT;
  
                disconnect = disconnect_mount(p, how);
 -
                if (mnt_has_parent(p)) {
                        mnt_add_count(p->mnt_parent, -1);
                        if (!disconnect) {
                                list_add_tail(&p->mnt_child, &p->mnt_parent->mnt_mounts);
                        } else {
                                umount_mnt(p);
 -                              hlist_add_head(&p->mnt_umount, &unmounted);
                        }
                }
                change_mnt_propagation(p, MS_PRIVATE);
 +              if (disconnect)
 +                      hlist_add_head(&p->mnt_umount, &unmounted);
        }
  }
  
@@@ -1643,13 -1643,18 +1643,18 @@@ static inline bool may_mount(void
        return ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN);
  }
  
+ #ifdef        CONFIG_MANDATORY_FILE_LOCKING
  static inline bool may_mandlock(void)
  {
- #ifndef       CONFIG_MANDATORY_FILE_LOCKING
-       return false;
- #endif
        return capable(CAP_SYS_ADMIN);
  }
+ #else
+ static inline bool may_mandlock(void)
+ {
+       pr_warn("VFS: \"mand\" mount option not supported");
+       return false;
+ }
+ #endif
  
  /*
   * Now umount can handle mount points as well as block devices.
@@@ -1675,6 -1680,8 +1680,6 @@@ int ksys_umount(char __user *name, int 
        if (!(flags & UMOUNT_NOFOLLOW))
                lookup_flags |= LOOKUP_FOLLOW;
  
 -      lookup_flags |= LOOKUP_NO_EVAL;
 -
        retval = user_path_mountpoint_at(AT_FDCWD, name, lookup_flags, &path);
        if (retval)
                goto out;
@@@ -3044,7 -3051,7 +3049,7 @@@ long do_mount(const char *dev_name, con
                return -EINVAL;
  
        /* ... and get the mountpoint */
 -      retval = user_path(dir_name, &path);
 +      retval = user_path_at(AT_FDCWD, dir_name, LOOKUP_FOLLOW, &path);
        if (retval)
                return retval;
  
@@@ -3591,13 -3598,11 +3596,13 @@@ SYSCALL_DEFINE2(pivot_root, const char 
        if (!may_mount())
                return -EPERM;
  
 -      error = user_path_dir(new_root, &new);
 +      error = user_path_at(AT_FDCWD, new_root,
 +                           LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &new);
        if (error)
                goto out0;
  
 -      error = user_path_dir(put_old, &old);
 +      error = user_path_at(AT_FDCWD, put_old,
 +                           LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &old);
        if (error)
                goto out1;
  
This page took 0.084657 seconds and 4 git commands to generate.