@@ -315,7 +315,7 @@ void afs_dynroot_rmdir(struct afs_net *net, struct afs_cell *cell)
inode_lock(root->d_inode);
/* Don't want to trigger a lookup call, which will re-add the cell */
- subdir = try_lookup_one_len(cell->name, root, cell->name_len);
+ subdir = try_lookup_one_len(&init_user_ns, cell->name, root, cell->name_len);
if (IS_ERR_OR_NULL(subdir)) {
_debug("lookup %ld", PTR_ERR(subdir));
goto no_dentry;
@@ -2610,6 +2610,7 @@ static int lookup_one_len_common(struct user_namespace *mnt_userns,
/**
* try_lookup_one_len - filesystem helper to lookup single pathname component
+ * @mnt_userns: user namespace of the mount the lookup is performed from
* @name: pathname component to lookup
* @base: base directory to lookup from
* @len: maximum length @len should be interpreted to
@@ -2622,14 +2623,16 @@ static int lookup_one_len_common(struct user_namespace *mnt_userns,
*
* The caller must hold base->i_mutex.
*/
-struct dentry *try_lookup_one_len(const char *name, struct dentry *base, int len)
+struct dentry *try_lookup_one_len(struct user_namespace *mnt_userns,
+ const char *name, struct dentry *base,
+ int len)
{
struct qstr this;
int err;
WARN_ON_ONCE(!inode_is_locked(base->d_inode));
- err = lookup_one_len_common(&init_user_ns, name, base, len, &this);
+ err = lookup_one_len_common(mnt_userns, name, base, len, &this);
if (err)
return ERR_PTR(err);
@@ -64,7 +64,8 @@ extern struct dentry *user_path_create(int, const char __user *, struct path *,
extern void done_path_create(struct path *, struct dentry *);
extern struct dentry *kern_path_locked(const char *, struct path *);
-extern struct dentry *try_lookup_one_len(const char *, struct dentry *, int);
+extern struct dentry *try_lookup_one_len(struct user_namespace *, const char *,
+ struct dentry *, int);
extern struct dentry *lookup_one_len(struct user_namespace *mnt_userns,
const char *, struct dentry *, int);
extern struct dentry *lookup_one_len_unlocked(struct user_namespace *,