From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796175630; b=KjXf0qu3T774X5aMQpO8Y5wqV/8lF7DcAoqW9TWiG5t+WegRr+vQ0fpGakZadhuyrox0 QokMygwKnM2dQqk+oSFVZwPXNe4eSzoUjqb1aGnBmi1Njz3YJEPxzxK/CllX0Yl7ZOi4h kC6A4RTBaVh939W7GF6vIxF3/XgTjGhOZ4C2pzcITAb1mZoOMHWqL8O3rGnK3tq8Ri9o4 /jr7T9QXww0iV8GKfJYCpcSpf18SeIHToAwYPALPGbHflbh/3TFbodZkMwQIxbgivQNly rItyZjEGZ3Lvy6LL/a4Rr6Z+C1acUC90hoykbpVld0QoWA+O0GEk+d8ODjTgT4gJcuA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796175630; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:Cc: Subject:To:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=jq7KbQM2vgWFT8Mi/wCi9pDqMm9OQUo9KvUDLhzG+2E=; b=dKam3dNeEPnePTc6BgAfqiSGqi0ZXWuORvDk4PyvJdenhDVUz9pklZ4/w9i17/prwq70 xIVJNC++R5K7H4Tsd0F/y1sk01xQAUtpZwfn0mcLae01E/2Rbk/2eRZ4sFS545bnN9Qv2 o/9xECw5vhAgHWw5B1Pqpyr0frKgKL3GFmhseun+/3ynfCiWUfsBf/jergooPuNyYQbvV cENUrm1L2lBiGa09v5sBXc5xsO3ATYT0MXbG3S3hcv0grIXorEdu3yMEJG/oOSjGpje66 kL7eYjPjAri+MZWzGyJHtjjorEh9HziDr20Q2ZD/DLfk/nxqUaGSbdN4jLGHREMTljg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="B0VtID/M"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CC66606A325; Wed, 2 Dec 2026 01:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B0VtID/M Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD0FF1F00A2B; Wed, 2 Dec 2026 01:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796175629; bh=jq7KbQM2vgWFT8Mi/wCi9pDqMm9OQUo9KvUDLhzG+2E=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=B0VtID/Mr3atdSHD85QxrIfTc3MzqlzP4Atn5oEUqj02yDr2+2Hcue2zmy1lpu6VB AqRrJhuzt4fReTmXAGnNoJUADJ/4F6u2QtJtUx56edkVHCKgrEpP50+PaOxf8Hy6AL +ValCOl8/z82RDV/7Jo7vOA3jaLN8i8N4sMQV3/FywISCc3+NJlpVkffc8iP7FLKfa yxM7DETYstcPiBH+PkmlIOh2/w2twHIdTnIhtc6gxrIBk6gtPX5dJzxu+9Fz1ym3G9 ijHizgjxBXIJl5aXKk7ohzhqcpooXA7MGTPayCOUCBIBCIiOXkmgK9jYGz1qbpRZ/t A2AdlwzyHRljw== Message-ID: <81d32e17-80f3-4792-8ef8-430d9b62867a@kernel.org> Date: Wed, 2 Dec 2026 09:40:27 +0800 X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, Daeho Jeong , stable@vger.kernel.org Subject: Re: [PATCH v2] f2fs: cover the checkpoint of device aliasing ioctls with gc_lock To: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com References: <20261201171944.3919669-1-daeho43@gmail.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20261201171944.3919669-1-daeho43@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/2/26 01:19, Daeho Jeong wrote: > From: Daeho Jeong > > f2fs_ioc_reserve_dev_alias() and f2fs_ioc_release_dev_alias() write the > checkpoint at their end after they released gc_lock. All the other > callers of f2fs_write_checkpoint() on a mounted filesystem hold gc_lock, > so only these two checkpoints can run while another task holds gc_lock. > > f2fs_ioc_reserve_dev_alias() is such a task: it moves the cursegs out of > the range of the alias device with gc_lock held, before it takes > f2fs_lock_op(). do_checkpoint() copies the positions of the cursegs into > the checkpoint first and writes their summaries later. If the checkpoint > of another alias ioctl is in progress and a curseg is moved in between, > the checkpoint does not match it. > > Hold gc_lock for the checkpoint in both ioctls, as the other callers do. > > Test: two alias files, with a debug patch which makes do_checkpoint() > of the release ioctl sleep after it copied the curseg positions. A > reserve ioctl on the other alias file moved the warm data curseg during > that sleep, and the checkpoint recorded the segment the curseg had left. > With this patch, the reserve ioctl waits for the checkpoint and moves > the curseg after it. > > Fixes: eae3faf210bd ("f2fs: support dynamic reserve/release for device aliasing") > Cc: stable@vger.kernel.org > Suggested-by: Chao Yu > Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks,