Skip to content

Commit 4643611

Browse files
author
Al Viro
committed
vfat_revalidate{,_ci}(): use stable parent inode passed by caller
Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 14d02c3 commit 4643611

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

fs/fat/namei_vfat.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,9 @@ static inline void vfat_d_version_set(struct dentry *dentry,
4343
* If it happened, the negative dentry isn't actually negative
4444
* anymore. So, drop it.
4545
*/
46-
static int vfat_revalidate_shortname(struct dentry *dentry)
46+
static bool vfat_revalidate_shortname(struct dentry *dentry, struct inode *dir)
4747
{
48-
int ret = 1;
49-
spin_lock(&dentry->d_lock);
50-
if (!inode_eq_iversion(d_inode(dentry->d_parent), vfat_d_version(dentry)))
51-
ret = 0;
52-
spin_unlock(&dentry->d_lock);
53-
return ret;
48+
return inode_eq_iversion(dir, vfat_d_version(dentry));
5449
}
5550

5651
static int vfat_revalidate(struct inode *dir, const struct qstr *name,
@@ -62,7 +57,7 @@ static int vfat_revalidate(struct inode *dir, const struct qstr *name,
6257
/* This is not negative dentry. Always valid. */
6358
if (d_really_is_positive(dentry))
6459
return 1;
65-
return vfat_revalidate_shortname(dentry);
60+
return vfat_revalidate_shortname(dentry, dir);
6661
}
6762

6863
static int vfat_revalidate_ci(struct inode *dir, const struct qstr *name,
@@ -99,7 +94,7 @@ static int vfat_revalidate_ci(struct inode *dir, const struct qstr *name,
9994
if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
10095
return 0;
10196

102-
return vfat_revalidate_shortname(dentry);
97+
return vfat_revalidate_shortname(dentry, dir);
10398
}
10499

105100
/* returns the length of a struct qstr, ignoring trailing dots */

0 commit comments

Comments
 (0)