**mandatory**
+The ->setlease() file_operation must now be explicitly set in order to provide
+support for leases. When set to NULL, the kernel will now return -EINVAL to
+attempts to set a lease. Filesystems that wish to use the kernel-internal lease
+implementation should set it to generic_setlease().
++
++---
++
++**mandatory**
++
+ fs/namei.c primitives that consume filesystem references (do_renameat2(),
+ do_linkat(), do_symlinkat(), do_mkdirat(), do_mknodat(), do_unlinkat()
+ and do_rmdir()) are gone; they are replaced with non-consuming analogues
+ (filename_renameat2(), etc.)
+ Callers are adjusted - responsibility for dropping the filenames belongs
+ to them now.
lookup_flags &= ~LOOKUP_AUTOMOUNT;
if (flags & AT_SYMLINK_NOFOLLOW)
lookup_flags &= ~LOOKUP_FOLLOW;
- if (flags & AT_EMPTY_PATH)
- lookup_flags |= LOOKUP_EMPTY;
- if (detached && !may_mount())
+ /*
+ * If we create a new mount namespace with the cloned mount tree we
+ * just care about being privileged over our current user namespace.
+ * The new mount namespace will be owned by it.
+ */
+ if ((flags & OPEN_TREE_NAMESPACE) &&
+ !ns_capable(current_user_ns(), CAP_SYS_ADMIN))
+ return ERR_PTR(-EPERM);
+
+ if ((flags & OPEN_TREE_CLONE) && !may_mount())
return ERR_PTR(-EPERM);
- ret = user_path_at(dfd, filename, lookup_flags, &path);
+ CLASS(filename_uflags, name)(filename, flags);
+ ret = filename_lookup(dfd, name, lookup_flags, &path, NULL);
if (unlikely(ret))
return ERR_PTR(ret);