Revert "vfs: add lookup_hash() helper"
This reverts commit3c9fe8cdff
. As Miklos points out in commitc1b2cc1a76
, the "lookup_hash()" helper is now unused, and in fact, with the hash salting changes, since the hash of a dentry name now depends on the directory dentry it is in, the helper function isn't even really likely to be useful. So rather than keep it around in case somebody else might end up finding a use for it, let's just remove the helper and not trick people into thinking it might be a useful thing. For example, I had obviously completely missed how the helper didn't follow the normal dentry hashing patterns, and how the hash salting patch broke overlayfs. Things would quietly build and look sane, but not work. Suggested-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e7b4f2d8ed
commit
20d00ee829
33
fs/namei.c
33
fs/namei.c
|
@ -2395,33 +2395,6 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(vfs_path_lookup);
|
EXPORT_SYMBOL(vfs_path_lookup);
|
||||||
|
|
||||||
/**
|
|
||||||
* lookup_hash - lookup single pathname component on already hashed name
|
|
||||||
* @name: name and hash to lookup
|
|
||||||
* @base: base directory to lookup from
|
|
||||||
*
|
|
||||||
* The name must have been verified and hashed (see lookup_one_len()). Using
|
|
||||||
* this after just full_name_hash() is unsafe.
|
|
||||||
*
|
|
||||||
* This function also doesn't check for search permission on base directory.
|
|
||||||
*
|
|
||||||
* Use lookup_one_len_unlocked() instead, unless you really know what you are
|
|
||||||
* doing.
|
|
||||||
*
|
|
||||||
* Do not hold i_mutex; this helper takes i_mutex if necessary.
|
|
||||||
*/
|
|
||||||
struct dentry *lookup_hash(const struct qstr *name, struct dentry *base)
|
|
||||||
{
|
|
||||||
struct dentry *ret;
|
|
||||||
|
|
||||||
ret = lookup_dcache(name, base, 0);
|
|
||||||
if (!ret)
|
|
||||||
ret = lookup_slow(name, base, 0);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(lookup_hash);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lookup_one_len - filesystem helper to lookup single pathname component
|
* lookup_one_len - filesystem helper to lookup single pathname component
|
||||||
* @name: pathname component to lookup
|
* @name: pathname component to lookup
|
||||||
|
@ -2493,6 +2466,7 @@ struct dentry *lookup_one_len_unlocked(const char *name,
|
||||||
struct qstr this;
|
struct qstr this;
|
||||||
unsigned int c;
|
unsigned int c;
|
||||||
int err;
|
int err;
|
||||||
|
struct dentry *ret;
|
||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.len = len;
|
this.len = len;
|
||||||
|
@ -2524,7 +2498,10 @@ struct dentry *lookup_one_len_unlocked(const char *name,
|
||||||
if (err)
|
if (err)
|
||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
|
|
||||||
return lookup_hash(&this, base);
|
ret = lookup_dcache(&this, base, 0);
|
||||||
|
if (!ret)
|
||||||
|
ret = lookup_slow(&this, base, 0);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(lookup_one_len_unlocked);
|
EXPORT_SYMBOL(lookup_one_len_unlocked);
|
||||||
|
|
||||||
|
|
|
@ -81,8 +81,6 @@ extern int kern_path_mountpoint(int, const char *, struct path *, unsigned int);
|
||||||
|
|
||||||
extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
|
extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
|
||||||
extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int);
|
extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int);
|
||||||
struct qstr;
|
|
||||||
extern struct dentry *lookup_hash(const struct qstr *, struct dentry *);
|
|
||||||
|
|
||||||
extern int follow_down_one(struct path *);
|
extern int follow_down_one(struct path *);
|
||||||
extern int follow_down(struct path *);
|
extern int follow_down(struct path *);
|
||||||
|
|
Loading…
Reference in New Issue