diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-01 04:57:42 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-22 20:27:56 +0200 |
commit | 9a7dddcaffff3890b9991d014c9a2b5392806526 (patch) | |
tree | 380b9896726e763dd1b31c14e815c401e65532b0 /fs/adfs | |
parent | adfs_lookup_byname: .. *is* taken care of in fs/namei.c (diff) | |
download | linux-9a7dddcaffff3890b9991d014c9a2b5392806526.tar.xz linux-9a7dddcaffff3890b9991d014c9a2b5392806526.zip |
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>
Diffstat (limited to 'fs/adfs')
-rw-r--r-- | fs/adfs/dir.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 77a2d6ca3c60..e18eff854e1a 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -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); if (error == 0) { - error = -EACCES; /* * This only returns NULL if get_empty_inode * fails. */ inode = adfs_iget(dir->i_sb, &obj); - if (inode) - error = 0; + if (!inode) + inode = ERR_PTR(-EACCES); + } else if (error != -ENOENT) { + inode = ERR_PTR(error); } - d_add(dentry, inode); - return ERR_PTR(error); + return d_splice_alias(inode, dentry); } /* |