linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix to avoid unneeded unlock_new_inode
@ 2016-03-10 14:24 Chao Yu
  0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2016-03-10 14:24 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-kernel

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>
---
 fs/f2fs/namei.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 7b07a47..7876f10 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);
 }

-- 
2.7.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-10 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 14:24 [PATCH] f2fs: fix to avoid unneeded unlock_new_inode Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).