From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0AE732D47F4 for ; Fri, 21 Aug 2026 23:48:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787356141; cv=none; b=WKG+zStaIpR3XqJwFGa20nsJULS4RJOvxv/9vSC/daKYbNwbfDnwbBxxGLFfGVjZFk+/DAbe1WRQ7cQJi/fw//EbQd+ZJTIO5tVXIkBINwwhdoW0hb7HRQyqOpgfkAOo0DfwEtmwXuqG6ORJeapeRdQgb8vWmQ7eyBv7KPT77J0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787356141; c=relaxed/simple; bh=T3RYZJFL9k4kG9vWoHhX3dO/QyYBNqBD8nVpXrW9RNY=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=te3IhSIgUqfCO2zixMIxtEuNQzmIfHv8olAe425/FAaCmicDehz+xCLl9tVTh7+VlxgwvZyCprp5vCT+kU3seOthhwQfRE6rWQDRXafNlOAqclc+cJ9c8Icf3WU2PTVIjyqdwDBl8EHHor8kKf1iDjPX8MBgYZPEMbqqpYE7Flg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jSeI0XYi; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jSeI0XYi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7D0B1F000E9; Fri, 21 Aug 2026 23:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787356139; bh=Ma/ef2lZGcYxtUb0BPiUJZjS1WnELcgKip4oPnNAKHQ=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=jSeI0XYifBHfJnsiTyo1Xw9ytbSoss4ZqzI1RWHqABHsVzI7M4rK2YFr5x1C9JhC4 OI4RyIOaMe2Of1hc1wiQVm4fLDy6rA6u4o80jHlpCa40POypSbovM4VP/OrKQwWaee RMVp5z6WiIaZgz8M2YSWL9DRRS1YKCEwEJtYy/iRO77cQBugq+lHPLRctjlg8RYjSF mb1/1XQ9mdNppuMe0pGNIP4TUQFXMD0jhCGBRg28n3JsO4sH2GXTCFqvo5ZbUH+g1p L5qpj5YQBFNrF5YYrKdAMdPctsBd3Defoth1tbCpvJ/EPe5OlqJ8OjZZM9ZLDRa6Yn M8Al/sWutihPg== Message-ID: Date: Sat, 22 Aug 2026 07:48:55 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Christophe JAILLET , kernel-team@android.com, stable@kernel.org Subject: Re: [f2fs-dev] [PATCH] f2fs: fix error handling on device alias check in rename and unlink To: Jaegeuk Kim , Daeho Jeong References: <20260821141742.2678300-1-daeho43@gmail.com> Content-Language: en-US From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/21/26 23:26, Jaegeuk Kim via Linux-f2fs-devel wrote: > On 08/21, Daeho Jeong wrote: >> From: Daeho Jeong >> >> 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. Jaegeuk, if we don't plan to merge them, we'd better keep the Fixes and stable line, otherwise, once the two patches be upstreamed, we may missed to backport the fix one due to the missing lines? Thanks, > >> Reported-by: Christophe JAILLET >> Signed-off-by: Daeho Jeong >> Reviewed-by: Chao Yu >> --- >> 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 > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel