The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: chao@kernel.org, Daeho Jeong <daehojeong@google.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] f2fs: cover the checkpoint of device aliasing ioctls with gc_lock
Date: Wed, 2 Dec 2026 09:40:27 +0800	[thread overview]
Message-ID: <81d32e17-80f3-4792-8ef8-430d9b62867a@kernel.org> (raw)
In-Reply-To: <20261201171944.3919669-1-daeho43@gmail.com>

On 12/2/26 01:19, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> 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 <chao@kernel.org>
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

      reply	other threads:[~2026-12-02  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 17:19 [PATCH v2] f2fs: cover the checkpoint of device aliasing ioctls with gc_lock Daeho Jeong
2026-12-02  1:40 ` Chao Yu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81d32e17-80f3-4792-8ef8-430d9b62867a@kernel.org \
    --to=chao@kernel.org \
    --cc=daeho43@gmail.com \
    --cc=daehojeong@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox