diff options
author | Chao Yu <chao@kernel.org> | 2016-03-10 09:24:23 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-03-18 00:19:46 -0400 |
commit | d726732c7ce951da5468b577a89ac26ce3f5a860 (patch) | |
tree | 51d1cc310d3daef91d8c4671fdcd98e93db2a223 | |
parent | 291bf80becdfbb4cfc726dbd1811b28cedb4d907 (diff) |
f2fs: fix to avoid unneeded unlock_new_inode
During ->lookup, I_NEW state of inode was been cleared in f2fs_iget,
so in error path, we don't need to clear it again.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/namei.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 7b07a4799952..7876f1052101 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c | |||
@@ -308,13 +308,13 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, | |||
308 | !fscrypt_has_permitted_context(dir, inode)) { | 308 | !fscrypt_has_permitted_context(dir, inode)) { |
309 | bool nokey = f2fs_encrypted_inode(inode) && | 309 | bool nokey = f2fs_encrypted_inode(inode) && |
310 | !fscrypt_has_encryption_key(inode); | 310 | !fscrypt_has_encryption_key(inode); |
311 | iput(inode); | 311 | err = nokey ? -ENOKEY : -EPERM; |
312 | return nokey ? ERR_PTR(-ENOKEY) : ERR_PTR(-EPERM); | 312 | goto err_out; |
313 | } | 313 | } |
314 | return d_splice_alias(inode, dentry); | 314 | return d_splice_alias(inode, dentry); |
315 | 315 | ||
316 | err_out: | 316 | err_out: |
317 | iget_failed(inode); | 317 | iput(inode); |
318 | return ERR_PTR(err); | 318 | return ERR_PTR(err); |
319 | } | 319 | } |
320 | 320 | ||