From: Chao Yu Date: Thu, 10 Mar 2016 14:24:23 +0000 (+0800) Subject: f2fs: fix to avoid unneeded unlock_new_inode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d726732c7ce951da5468b577a89ac26ce3f5a860;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Jaegeuk Kim --- 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, !fscrypt_has_permitted_context(dir, inode)) { bool nokey = f2fs_encrypted_inode(inode) && !fscrypt_has_encryption_key(inode); - iput(inode); - return nokey ? ERR_PTR(-ENOKEY) : ERR_PTR(-EPERM); + err = nokey ? -ENOKEY : -EPERM; + goto err_out; } return d_splice_alias(inode, dentry); err_out: - iget_failed(inode); + iput(inode); return ERR_PTR(err); }