linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2 v3] f2fs: report ENOENT correct in f2fs_rename
Date: Thu, 20 Sep 2018 14:35:01 -0700	[thread overview]
Message-ID: <20180920213501.GA35918@jaegeuk-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <20180919225037.GC79681@jaegeuk-macbookpro.roam.corp.google.com>

This fixes wrong error report in f2fs_rename.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 Change log from v2:
  - remove needless err assignment
  - relocate err precisely

 fs/f2fs/namei.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 98d3ab7c3ce6..abbad9610fad 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -833,7 +833,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	struct f2fs_dir_entry *old_entry;
 	struct f2fs_dir_entry *new_entry;
 	bool is_old_inline = f2fs_has_inline_dentry(old_dir);
-	int err = -ENOENT;
+	int err;
 
 	if (unlikely(f2fs_cp_error(sbi)))
 		return -EIO;
@@ -860,6 +860,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
 			goto out;
 	}
 
+	err = -ENOENT;
 	old_entry = f2fs_find_entry(old_dir, &old_dentry->d_name, &old_page);
 	if (!old_entry) {
 		if (IS_ERR(old_page))
@@ -1025,7 +1026,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
 	struct f2fs_dir_entry *old_dir_entry = NULL, *new_dir_entry = NULL;
 	struct f2fs_dir_entry *old_entry, *new_entry;
 	int old_nlink = 0, new_nlink = 0;
-	int err = -ENOENT;
+	int err;
 
 	if (unlikely(f2fs_cp_error(sbi)))
 		return -EIO;
@@ -1049,6 +1050,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
 	if (err)
 		goto out;
 
+	err = -ENOENT;
 	old_entry = f2fs_find_entry(old_dir, &old_dentry->d_name, &old_page);
 	if (!old_entry) {
 		if (IS_ERR(old_page))
-- 
2.17.0.441.gb46fe60e1d-goog


  parent reply	other threads:[~2018-09-20 21:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  2:18 [PATCH 1/2] f2fs: report ENOENT correct in f2fs_rename Jaegeuk Kim
2018-09-18  2:18 ` [PATCH 2/2] f2fs: avoid f2fs_bug_on if f2fs_get_meta_page_nofail got EIO Jaegeuk Kim
2018-09-18 13:16   ` [f2fs-dev] " Chao Yu
2018-09-18 17:55     ` Jaegeuk Kim
2018-09-18 17:56   ` [PATCH 2/2 v2] " Jaegeuk Kim
2018-09-19  1:45     ` [f2fs-dev] " Chao Yu
2018-09-19 22:47       ` Jaegeuk Kim
2018-09-20  6:07     ` Chao Yu
2018-09-20 21:46       ` Jaegeuk Kim
2018-09-21  1:30         ` Chao Yu
2018-09-26  0:18           ` Jaegeuk Kim
2018-09-26  1:10             ` Chao Yu
2018-09-26  8:31               ` Chao Yu
2018-09-26 19:49                 ` Jaegeuk Kim
2018-09-27  1:14                   ` Chao Yu
2018-09-27  4:58                     ` Jaegeuk Kim
2018-09-27  5:45                       ` Chao Yu
2018-09-20 21:48     ` [f2fs-dev] [PATCH 2/2 v3] " Jaegeuk Kim
2018-09-27 12:09       ` Chao Yu
2018-09-18 12:47 ` [f2fs-dev] [PATCH 1/2] f2fs: report ENOENT correct in f2fs_rename Chao Yu
2018-09-18 17:59   ` Jaegeuk Kim
2018-09-19  1:48     ` Chao Yu
2018-09-19  0:47 ` Sahitya Tummala
2018-09-19 22:50 ` [PATCH 1/2 v2] " Jaegeuk Kim
2018-09-20  6:14   ` [f2fs-dev] " Chao Yu
2018-09-20 21:35   ` Jaegeuk Kim [this message]
2018-09-21  1:31     ` [f2fs-dev] [PATCH 1/2 v3] " Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180920213501.GA35918@jaegeuk-macbookpro.roam.corp.google.com \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).