From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>
Cc: linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Daeho Jeong <daehojeong@google.com>,
stable@kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix error handling on device alias check in rename and unlink
Date: Fri, 21 Aug 2026 15:26:06 +0000 [thread overview]
Message-ID: <aohuDgLbl5SSnJ9T@google.com> (raw)
In-Reply-To: <20260821141742.2678300-1-daeho43@gmail.com>
On 08/21, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> In f2fs_rename() and f2fs_unlink(), directly returning -EPERM when
> encountering a device aliasing file bypasses the cleanup path.
>
> Fix this by setting err to -EPERM and jumping to the proper cleanup
> labels (out_dir and out) instead of returning immediately.
>
> Fixes: a737e409a3d6 ("f2fs: support dynamic reserve/release for device aliasing")
> Cc: stable@kernel.org
Applied without Fixes and stable, since the original patch has not been
upstreamed.
> Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> Reviewed-by: Chao Yu <chao@kernel.org>
> ---
> fs/f2fs/namei.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
> index 784f636244e1..b9b15c5d28de 100644
> --- a/fs/f2fs/namei.c
> +++ b/fs/f2fs/namei.c
> @@ -571,8 +571,10 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
>
> trace_f2fs_unlink_enter(dir, dentry);
>
> - if (IS_DEVICE_ALIASING(inode))
> - return -EPERM;
> + if (IS_DEVICE_ALIASING(inode)) {
> + err = -EPERM;
> + goto out;
> + }
>
> if (unlikely(f2fs_cp_error(sbi))) {
> err = -EIO;
> @@ -1025,8 +1027,10 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
> }
>
> if (new_inode) {
> - if (IS_DEVICE_ALIASING(new_inode))
> - return -EPERM;
> + if (IS_DEVICE_ALIASING(new_inode)) {
> + err = -EPERM;
> + goto out_dir;
> + }
>
> err = -ENOTEMPTY;
> if (old_is_dir && !f2fs_empty_dir(new_inode))
> --
> 2.55.0.766.g2966f0265a-goog
>
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2026-08-21 15:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 14:17 [PATCH] f2fs: fix error handling on device alias check in rename and unlink Daeho Jeong
2026-08-21 15:26 ` Jaegeuk Kim [this message]
2026-08-21 23:48 ` [f2fs-dev] " Chao Yu
2026-08-22 0:12 ` Jaegeuk Kim
2026-08-22 7:10 ` Chao Yu
2026-08-21 15:50 ` patchwork-bot+f2fs
-- strict thread matches above, loose matches on Subject: below --
2026-08-21 1:18 Daeho Jeong
2026-08-21 1:31 ` [f2fs-dev] " 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=aohuDgLbl5SSnJ9T@google.com \
--to=jaegeuk@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=daeho43@gmail.com \
--cc=daehojeong@google.com \
--cc=kernel-team@android.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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