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 CA4E4421238 for ; Fri, 21 Aug 2026 15:26:08 +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=1787325969; cv=none; b=MekuL5pp21HGQgWup0Plx3ZvxjNSedoF0cQDaVKBq5WJduClaQbzgOyXB3njbdyP7a160NwzDt5nRpgV5HrQL5+tqY84xo82tkrs9OK+Dz8fGAETXHmxGHAEVJdo0V4LB9QKEszxIX5OTNa/V/HFCxfHs/3lY+TuvxqGgDBzjMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787325969; c=relaxed/simple; bh=SCbazL61KW3vGhMFYpErm86u9PHAeeLVhpaDT7UUMNU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U7bfgudvoahHw56hIO+4+KwVoYsrXU59TlUTURzbPc0zWYh0Fyh9VezSctNag0b/2z9qGaocOYaSr7E2zWA8aAao1u9Dd5gOqS0+Jm3/+rs15ECgglvdttpXGaCHSNATzx80UeB2HQifHcPZPezeNrWSax4rUxGAiklZXnSYDhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Emjrd3K/; 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="Emjrd3K/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38B4E1F000E9; Fri, 21 Aug 2026 15:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787325968; bh=zgvC+ZCXI1rwTwuEGY8JXlZpfQViE/VMlFibVJTRVQM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Emjrd3K/rVNG/oKNRDM19baqYHO7vIUsrG4htuMywOdGnnE80NR1RE/tE8bB55XJo folzNw7ofcYiwW7BP/NBFEhI9ht1wMkcs470L4QUlpGHZfYq0zc7Lco7vJiUGWZN3a wbK6axPvBp0axPUTfsXjFTcQI0ponpmSDzh7hXWsIAOjysISrJ8LaX5ZAfzIHSo/mz +grbu7BGeK0BqPoOVO9kUFykyDskqwfhRcUlCtme0rv/01g3RdyBq7pzfUBc2kPvW1 WjUEc78QpEuyIpqzyFpkjWO8Pa1xZGDIbObrXPnYPiXXutwx0bfzFdRQZA68HqGuYZ j8D+lPYkIdeUA== Date: Fri, 21 Aug 2026 15:26:06 +0000 From: Jaegeuk Kim To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Christophe JAILLET , Daeho Jeong , 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: <20260821141742.2678300-1-daeho43@gmail.com> 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. > 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