Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp153726imm; Tue, 18 Sep 2018 18:49:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ3+NSguCKUmkeWDVP9rJih3f+B4Xigvwl8ODusWpHHc+mGh3/PgPV1+AgHOPyOdR8HeV++ X-Received: by 2002:a62:5d89:: with SMTP id n9-v6mr33528394pfj.102.1537321753727; Tue, 18 Sep 2018 18:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537321753; cv=none; d=google.com; s=arc-20160816; b=UWeCMyDVLr+hsXNvSPmnpgrZwaM3WrR9UyU7olT72lar59O/yhOzhcrXO4NpszWLet D+C6+F3xyHt5lBI10D792wn3LEkeoX75Bww4x/YuIwP7axh5MsqrBsOfJkwZvSHeq1G7 MVL1u/J5w8l3WNGhgt183+dCyCak6gNnNJKuoxbFdWoTJ/qhIrW2pc2vWD5ZRJgwh/+L LQiCdkDPlwBMAdSIxSO0HabnNIZ3Xqj8nYuKmYqV3XPFcqCjpfdd5L9xerjyZGffFO0X ji8KJXYEUT8IbylZgKy83cRv3Z5htfCf5Uzo089i5QIHJYK2ZqcVzo0YMeIj54UxP8sP VUxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=SDSGfgSKVhk0CqMLLhysYx/6fqcCIbra1F1Z7Z2grkw=; b=MVtOWFIZvd+BjwLNIk5KUAFcUniXgW22712WpEtTuQu6ds9BW4F47DHS15wf0cIzyj JiBHsAuPHB3mFnmtIRv5EWFw88HKVxSgFg9ahtQ/dQYTkPkCMcKBuCk5UZ4c6pRPc9jx LpccZLJhzyOD9my3ub4WxnxM65fo7Kxf4zSB0U5YWMj0Q9Fo49qlMOne7ScMlg/5ztk7 1MVBeG+0ts7LZNc3YCpBEvGo0rO2BW1Bdtul6x4+vr2xrtyAZHtSCG1V8pUCEU1qjLE+ bMVW8LX5DCndQxaIIranksIAAPG9ayDraZ4T4+GXjc16bHtP3KlpANTL0lKoR/Pxh2EM so3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 198-v6si20657216pfz.119.2018.09.18.18.48.57; Tue, 18 Sep 2018 18:49:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730681AbeISHYO (ORCPT + 99 others); Wed, 19 Sep 2018 03:24:14 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12614 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728226AbeISHYO (ORCPT ); Wed, 19 Sep 2018 03:24:14 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3E86E37936025; Wed, 19 Sep 2018 09:48:49 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.399.0; Wed, 19 Sep 2018 09:48:46 +0800 Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: report ENOENT correct in f2fs_rename To: Jaegeuk Kim , Chao Yu CC: , References: <20180918021805.85032-1-jaegeuk@kernel.org> <20180918175936.GF91945@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: Date: Wed, 19 Sep 2018 09:48:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180918175936.GF91945@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/9/19 1:59, Jaegeuk Kim wrote: > On 09/18, Chao Yu wrote: >> On 2018/9/18 10:18, Jaegeuk Kim wrote: >>> This fixes wrong error report in f2fs_rename. >>> >>> Signed-off-by: Jaegeuk Kim >>> --- >>> fs/f2fs/namei.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c >>> index 98d3ab7c3ce6..d653be777529 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; >>> @@ -854,6 +854,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, >>> if (err) >>> goto out; >>> >>> + err = -ENOENT; >> >> I didn't get what's the difference after moving initialization of 'err' here... > > One example, > > old_entry = f2fs_find_entry(old_dir, &old_dentry->d_name, &old_page); > if (!old_entry) { > if (IS_ERR(old_page)) > err = PTR_ERR(old_page); > > --> need to return ENOENT instead of 0. Clear for me now, thanks for your explanation, I just miss that case. ;) It would be better to add this into commit log. I agree with Sahitya, we need to cover rename2 as well. Thanks, > > goto out; > } > >> >> Thanks, >> >>> if (new_inode) { >>> err = dquot_initialize(new_inode); >>> if (err) >>> > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > >