Message ID | 20240112171645.3929428-1-jaegeuk@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-24911-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp318895dyc; Fri, 12 Jan 2024 09:17:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBdNqVsNdws1KoYcrMLrNW9tspmQRgK3FYbjEqerzewtvu3TPoBLRAJiIa/cbDEHLhRIvt X-Received: by 2002:a05:620a:12f1:b0:783:84d:c4f3 with SMTP id f17-20020a05620a12f100b00783084dc4f3mr1859671qkl.31.1705079827177; Fri, 12 Jan 2024 09:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705079827; cv=none; d=google.com; s=arc-20160816; b=QG2TnTZCPOcN7f1vrpXsak1li68R8Rh5CpzRNunNBkBs+StFpAj0bfBDNZa4Bs57cE 9e+7ENOLYaOiBa6OpijDwoLFOxqM9AGSqUUnAWDyJ8XITGeXsyfnwP9sHbYqa1N8FeBD J78Pv/97Gi1CDbUMEmg0HenB+m1u7lVZ56V21eRlMgOC0YAxXKqlckLspkMFXSgBT33V 2GYZOkO6mg1VOH/x1kyH6Fr+hI/DowmB69ogfXNaFtNKaUxKH5U9cr7Obqnm13cZIF8K o5aV8LFPry6IXOZSfBs2URUeO7m53SKwLNC1sL+XC6/OGNlJov4afmpTp+DSow4STVyL CElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=liF3vtcdzBZo47/KspwGwE27wtHQ9MztXTADu2RcTlU=; fh=+mwqoU19BUSoH3YVLt9+WIDCS67JKz1qH2LN73oOYq4=; b=geEb4wg3Qkd+tGviExh73RHeeoucLf/z9FaDl1POPfz/tFBlxffGkNsJ9Dj3fUmbYR 43WEj8v48tlCINSrK9VOa9OssKKbcNrYmqN8nx9U3YBAgUj0QX8jkLO3HQG3mImQmKqY OzxOtf1VEi/gTCmYiNyLRIs8jlxh1ZLMuUmLpKU7xWF4LO+BB8ShlEFCvSdnM74/BtWf cPP+bnQ3mxWoT8Cbi0blH9QWxdEOYX66FU3YOjY4dD0t6WxOXQN/b3cOvlouJfKCjK8u wB0m5DVLrrZW2yjrsxX205p0VcY7erAtmOGSPTdUpQyGlrkqkYaWK860A19Lix7r9PQY bZGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJjpyS+W; spf=pass (google.com: domain of linux-kernel+bounces-24911-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24911-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b11-20020a05620a0ccb00b00781cc3f5113si3151670qkj.749.2024.01.12.09.17.06 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 09:17:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24911-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJjpyS+W; spf=pass (google.com: domain of linux-kernel+bounces-24911-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24911-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BC4111C21F6C for <ouuuleilei@gmail.com>; Fri, 12 Jan 2024 17:17:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF2B217C78; Fri, 12 Jan 2024 17:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kJjpyS+W" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6410522603 for <linux-kernel@vger.kernel.org>; Fri, 12 Jan 2024 17:16:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0B79C433C7; Fri, 12 Jan 2024 17:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705079812; bh=lryv/farYg+kjJnYzgoPmLVHiOFuDwPZIzxjpW3gLXk=; h=From:To:Cc:Subject:Date:From; b=kJjpyS+WcmdNVBnqw2w0+DO9Nx1eDtj14ip+T9pZ4gGXCSR1tgVZBju9cf5qT7JaV TwFkmGRPWyYxGd2Kdz353JHiLwRPBp7mo8biHW+YkVtn3cjgCbIg42f+t6o+cQI220 /V7LfJOaA0WIpnGaNuJF5fBFzD5Sb2GIYpL/fxfJBUCIVLt9J+XKHkYY/kYRJZw/CU vZMTFfORwmK+mwkSEsZZD/thYi9ongQqzksdhZ+6wlkrdnTNlMUBbRrfvKvsPiDeY9 +eBWAQIrV9YAeLA/E8fkLbRpzxmdp2VFvUxNpU2axoHLnWOspls3U+UmGXeZmbXwhx gJKVx299R+VIQ== From: Jaegeuk Kim <jaegeuk@kernel.org> To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim <jaegeuk@kernel.org>, Al Viro <viro@zeniv.linux.org.uk> Subject: [PATCH] f2fs: remove unnecessary f2fs_put_page in f2fs_rename Date: Fri, 12 Jan 2024 09:16:45 -0800 Message-ID: <20240112171645.3929428-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.43.0.275.g3460e3d667-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787905785136428539 X-GMAIL-MSGID: 1787905785136428539 |
Series |
f2fs: remove unnecessary f2fs_put_page in f2fs_rename
|
|
Commit Message
Jaegeuk Kim
Jan. 12, 2024, 5:16 p.m. UTC
[1] changed the below condition, which made f2fs_put_page() voided.
This patch reapplies the AL's resolution in -next from [2].
- if (S_ISDIR(old_inode->i_mode)) {
+ if (old_is_dir && old_dir != new_dir) {
old_dir_entry = f2fs_parent_dir(old_inode, &old_dir_page);
if (!old_dir_entry) {
if (IS_ERR(old_dir_page))
[1] 7deee77b993a ("f2fs: Avoid reading renamed directory if parent does not change")
[2] https://lore.kernel.org/all/20231220013402.GW1674809@ZenIV/
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/namei.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
Comments
On 2024/1/13 1:16, Jaegeuk Kim wrote: > [1] changed the below condition, which made f2fs_put_page() voided. > This patch reapplies the AL's resolution in -next from [2]. > > - if (S_ISDIR(old_inode->i_mode)) { > + if (old_is_dir && old_dir != new_dir) { > old_dir_entry = f2fs_parent_dir(old_inode, &old_dir_page); > if (!old_dir_entry) { > if (IS_ERR(old_dir_page)) > > [1] 7deee77b993a ("f2fs: Avoid reading renamed directory if parent does not change") > [2] https://lore.kernel.org/all/20231220013402.GW1674809@ZenIV/ > > Suggested-by: Al Viro <viro@zeniv.linux.org.uk> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <jaegeuk@kernel.org>: On Fri, 12 Jan 2024 09:16:45 -0800 you wrote: > [1] changed the below condition, which made f2fs_put_page() voided. > This patch reapplies the AL's resolution in -next from [2]. > > - if (S_ISDIR(old_inode->i_mode)) { > + if (old_is_dir && old_dir != new_dir) { > old_dir_entry = f2fs_parent_dir(old_inode, &old_dir_page); > if (!old_dir_entry) { > if (IS_ERR(old_dir_page)) > > [...] Here is the summary with links: - [f2fs-dev] f2fs: remove unnecessary f2fs_put_page in f2fs_rename https://git.kernel.org/jaegeuk/f2fs/c/fb09ad63d798 You are awesome, thank you!
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index b3bb815fc6aa..ba11298b7837 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -1105,14 +1105,11 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir, iput(whiteout); } - if (old_is_dir) { - if (old_dir_entry) - f2fs_set_link(old_inode, old_dir_entry, - old_dir_page, new_dir); - else - f2fs_put_page(old_dir_page, 0); + if (old_dir_entry) + f2fs_set_link(old_inode, old_dir_entry, old_dir_page, new_dir); + if (old_is_dir) f2fs_i_links_write(old_dir, false); - } + if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT) { f2fs_add_ino_entry(sbi, new_dir->i_ino, TRANS_DIR_INO); if (S_ISDIR(old_inode->i_mode))