mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
adfs_lookup: do not fail with ENOENT on negatives, use d_splice_alias()
Cc: Russell King <linux@armlinux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
686bb96d1b
commit
9a7dddcaff
@ -252,17 +252,17 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
|
|||||||
|
|
||||||
error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj);
|
error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj);
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
error = -EACCES;
|
|
||||||
/*
|
/*
|
||||||
* This only returns NULL if get_empty_inode
|
* This only returns NULL if get_empty_inode
|
||||||
* fails.
|
* fails.
|
||||||
*/
|
*/
|
||||||
inode = adfs_iget(dir->i_sb, &obj);
|
inode = adfs_iget(dir->i_sb, &obj);
|
||||||
if (inode)
|
if (!inode)
|
||||||
error = 0;
|
inode = ERR_PTR(-EACCES);
|
||||||
|
} else if (error != -ENOENT) {
|
||||||
|
inode = ERR_PTR(error);
|
||||||
}
|
}
|
||||||
d_add(dentry, inode);
|
return d_splice_alias(inode, dentry);
|
||||||
return ERR_PTR(error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user