Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chao Yu and committed by
Jaegeuk Kim
d726732c 291bf80b

+3 -3
+3 -3
fs/f2fs/namei.c
··· 308 308 !fscrypt_has_permitted_context(dir, inode)) { 309 309 bool nokey = f2fs_encrypted_inode(inode) && 310 310 !fscrypt_has_encryption_key(inode); 311 - iput(inode); 312 - return nokey ? ERR_PTR(-ENOKEY) : ERR_PTR(-EPERM); 311 + err = nokey ? -ENOKEY : -EPERM; 312 + goto err_out; 313 313 } 314 314 return d_splice_alias(inode, dentry); 315 315 316 316 err_out: 317 - iget_failed(inode); 317 + iput(inode); 318 318 return ERR_PTR(err); 319 319 } 320 320