diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-04-30 19:02:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-21 14:30:07 -0400 |
commit | f4e4d434fe3f5eceea470bf821683677dabe39c4 (patch) | |
tree | 20c52d934ddbb0dc24757197ab85b92e812a26b5 /fs | |
parent | 87fbd639c02ec96d67738e40b6521fb070ed7168 (diff) |
befs_lookup(): use d_splice_alias()
RTFS(Documentation/filesystems/nfs/Exporting) if you try to make
something exportable.
Fixes: ac632f5b6301 "befs: add NFS export support"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/befs/linuxvfs.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index af2832aaeec5..4700b4534439 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -198,23 +198,16 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) | |||
198 | 198 | ||
199 | if (ret == BEFS_BT_NOT_FOUND) { | 199 | if (ret == BEFS_BT_NOT_FOUND) { |
200 | befs_debug(sb, "<--- %s %pd not found", __func__, dentry); | 200 | befs_debug(sb, "<--- %s %pd not found", __func__, dentry); |
201 | d_add(dentry, NULL); | 201 | inode = NULL; |
202 | return ERR_PTR(-ENOENT); | ||
203 | |||
204 | } else if (ret != BEFS_OK || offset == 0) { | 202 | } else if (ret != BEFS_OK || offset == 0) { |
205 | befs_error(sb, "<--- %s Error", __func__); | 203 | befs_error(sb, "<--- %s Error", __func__); |
206 | return ERR_PTR(-ENODATA); | 204 | inode = ERR_PTR(-ENODATA); |
205 | } else { | ||
206 | inode = befs_iget(dir->i_sb, (ino_t) offset); | ||
207 | } | 207 | } |
208 | |||
209 | inode = befs_iget(dir->i_sb, (ino_t) offset); | ||
210 | if (IS_ERR(inode)) | ||
211 | return ERR_CAST(inode); | ||
212 | |||
213 | d_add(dentry, inode); | ||
214 | |||
215 | befs_debug(sb, "<--- %s", __func__); | 208 | befs_debug(sb, "<--- %s", __func__); |
216 | 209 | ||
217 | return NULL; | 210 | return d_splice_alias(inode, dentry); |
218 | } | 211 | } |
219 | 212 | ||
220 | static int | 213 | static int |