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 BE00717C203 for ; Sat, 22 Aug 2026 00:12:22 +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=1787357543; cv=none; b=ZTTmDx7Z4RJp/3okp75EJpurLQHTy/s+QvlhBaTyYU9SSUARLyEtvaCYv8STzxG7o6lS+3B1vvb65mX76YTM98RHleqfpr4bwss9Sp8YGrHps0EnqOitvAtgcEJAjVs3GcafAL8+UuTaA98LmCrq697Y0AGM6hfbrESd/5DBqHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787357543; c=relaxed/simple; bh=AZrbvW8SR61i5gxqq04ihBZPPfZyC4ha/9lIZ2P/+ec=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bpK4fy06CUk068WSpNTgJBhiJ73uAZGmj/hALVlOOHmfXbIg2h6vY6HSARXoErbTI3vBDNp0kJAPDwnUM6Bz37XWsh2G6meVdJh6IsxZfn0dmF5Bn3RTc3L8mPI/xLT8l3CjDFoeY+cVExbFm4n4rC9Po6Aqf9c5ZlrpgpQ5WUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jj1Xwpu4; 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="jj1Xwpu4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A0C31F000E9; Sat, 22 Aug 2026 00:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787357542; bh=d2FbKGsrueBVUIH7/Kt3Vog6JqVelaagaHWOgYooyFA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=jj1Xwpu4i2ChvIodjGsDYwk16peiJ1AtAwJe0jgLFpvyNdsWRv9LSHIuZ7BfGr/jt Th9cRdDw6+LYCTZk+Dp0+TqMIE2bl4grnHCCf17RrMAhQinLps/LiqZbW0sgAKuPV3 ooDcqiBP6xN+8T7lwasCekGW2PsbNYyHr4W6W4+l26a4C8yzwHzxZIrYYo4BKLgyC6 MurevPLB44fOMRZ0JfhZx2rFWKZjWC8OkBn50Zmb1AnxDGOYi1mEL2Tir2Q9+ICnD4 XM6IRtHzxDKDvlgI/dBL1UQGERMtufgg/itWPneErBaKGI/EPr2eAVe9dHq3JwYSQz +PI1/BtLLe9lQ== Date: Sat, 22 Aug 2026 00:12:20 +0000 From: Jaegeuk Kim To: Chao Yu Cc: 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 Message-ID: References: <20260821141742.2678300-1-daeho43@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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. > > 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 >