From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.smtpout.orange.fr (smtp-80.smtpout.orange.fr [80.12.242.80]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AC4A3749FE for ; Fri, 21 Aug 2026 08:22:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.80 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787300578; cv=none; b=sPVcJxGk1EFPSN5IItKBMM38fgck3dMcXeUVNWx1sKTsAkeF1NIkPP4U42MT5g3laALTgCl8NEIM1cEcpY7GmfOf4pWhrmF7/u82ip60mSBXq15ZnQ5szA4B1WaxwgrnfVbSUY8WcTkVLdkGOCcvIyCAu6caa+kd55nckesXPWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787300578; c=relaxed/simple; bh=dc9JT0+SoW13bvQ9YHtlnaBmk8ckoWJUUsOwZjuoaoA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HthMSaIih0BnRFOj/HzYz044FRHVDwdGYaPgZP00AkjiMEllKqbVTYxGWolvm90a8wqQVstGUhQPxEjxxKof6acV/f/rJ5wB0iFw61svSYknTtEz6mYIYhLmje4p9gBauPR57HHJCKgeKcf+yNmWEZ5DEw1KeTg1iujSgwZIBKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=KKJF430i; arc=none smtp.client-ip=80.12.242.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="KKJF430i" Received: from [IPV6:2a01:cb10:785:b00:6128:9b8c:c203:905] ([10.65.86.65]) by smtp.orange.fr with ESMTP id xKVQwiUiAqSfhxKVQwPLvX; Fri, 21 Aug 2026 10:21:40 +0200 Received: from [IPV6:2a01:cb10:785:b00:6128:9b8c:c203:905] ([IPv6:2a01:cb10:785:b00:6128:9b8c:c203:905]) by smtp.orange.fr with ESMTPSA id xKVIwiv66xjiyxKVIw2ix2; Fri, 21 Aug 2026 10:21:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1787300493; bh=jvL9ik0khXWRl5coP2HL9T/t7eY9GXA67WUTdNRw3u8=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=KKJF430ipWHOJxMpmwJ1qqY6jliuuHDkXkkAHKshjUxBvdz7Q5Mgmr0+0nOmLmrNM kbJecVgFmaKsQ0Dfr7sXw+C2ZgMc+wckIDhSxu1FMHzFqqBNDrVpB/fpjEPvXu9WDZ oJH38qcnfRbHXvLR1uRYc7XHhWLJ0jDF/ilI1KOpmjpcE/njGF9CBf7QrTcyii+I5F h5ITHYn2ZxGsWa7tnGgXUxZWjf665P6TwrW6twSqj0KDcZl2APMuccxQFtUbc1zUoC dlThk3+4W4E9J95T0lDC5pIO7bABunw8sX0mcuUoXk4P+Gs/s4myxqepqkhdRnLy2I ZEhLgbEK6s0Pg== X-ME-Helo: [IPV6:2a01:cb10:785:b00:6128:9b8c:c203:905] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 21 Aug 2026 10:21:33 +0200 X-ME-IP: 2a01:cb10:785:b00:6128:9b8c:c203:905 Message-ID: <0fc4eebe-68a1-472f-9dee-fecd5dd85f06@wanadoo.fr> Date: Fri, 21 Aug 2026 10:21:32 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] f2fs: fix error handling on device alias check in rename and unlink To: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong , stable@kernel.org References: <20260821011812.2938998-1-daeho43@gmail.com> From: Christophe JAILLET Content-Language: en-US, fr-FR In-Reply-To: <20260821011812.2938998-1-daeho43@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 21/08/2026 à 03:18, Daeho Jeong a écrit : > 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 > Signed-off-by: Daeho Jeong Hi, if possible, a Reported-by: Christophe JAILLET would be appreciated. CJ> --- > 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))