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 7D24B3803C3 for ; Sat, 22 Aug 2026 07:10:06 +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=1787382607; cv=none; b=F8SUvw6l7uKDpdspoFriG3ZYI5kfcFGFDGKCiy1r5yO4O2DOxVW9jr/k1YdRmKPEyZzzby90jCF9oMmiEAYs6o6YlPHHQ/Xv5nhYIvSJYOrlhu9/Rpm43vEkBzHWlPRI117oCU3qEU7GofV54KoeNIrRHbOsPpuinGSlaay2KeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787382607; c=relaxed/simple; bh=6EEAYi5DILYyGWHouZorxr/JNvs+N3TO7/Nzl8pda30=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=Ws5/ovXxAf2tFUY99wEwcagMQc/jj2ojLRYiOhGM39Gp5mc5h9sqlLGOnWZweKp2c7S7NGhMtF6O1CbgSx2Xv9HGyI/rex/ZmO6ARjkBH+EurlmT716mqRK6WySkRuAkQ4b1xKchUW1FNfQuseRObIDHylG9A2Gh+jRhlDfsJ9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jluUBCci; 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="jluUBCci" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4488E1F000E9; Sat, 22 Aug 2026 07:10:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787382606; bh=z+PD1FJQQZXjGT39NUNG7iAD+zFhllq/eUNIq4cDZJ8=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=jluUBCcimzEAYB7eK+t4nluVxZGIEYxZbAtDrYV+nURl04SwbVFDjFKfl3imndG41 wyOlvb0ZxQKXY1sl560rr2hFDWUxMBfHTDX9/o8Q1EjxAgqRlsJ1vnrNQ1M04Zjn6y OY6GdsZhjzR6DtiyHfsaOueKe8da0Rs3BVkG5GPDj/d4lhfKQJWyeAe93pqj0Wtm/K claSyQ68MKOTmcYBT2A7pIrHgByl4gEqBHIkJFk0nAkXFimWXt0jCnPfYwUEdFTEpj MwaysiR+VQYSqNvaqz9sd4c9Y1PODbJ/ypZ8HOMuIpGVGXjqFGMqn0nDBbn2185YSN nNhS+YShXOFjw== Message-ID: <8d10a64e-f128-4287-b9a0-310992b0f372@kernel.org> Date: Sat, 22 Aug 2026 15:10:02 +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 , 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 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/22/26 08:12, Jaegeuk Kim wrote: > On 08/22, Chao Yu wrote: >> 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? > > My concern is the never existing hash in upstream. And, I don't think this will > go into any LTS. Oh, I see, actually, my concern is developers may potentially miss this fix when backporting related feature. Thanks, > >> >> 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 >>