mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Daeho Jeong <daeho43@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: Daeho Jeong <daehojeong@google.com>
Subject: Re: [PATCH v7] f2fs: support dynamic reserve/release for device aliasing
Date: Thu, 20 Aug 2026 22:30:47 +0200	[thread overview]
Message-ID: <ccec912d-5d80-4f9d-bdb2-c07a16c72b46@wanadoo.fr> (raw)
In-Reply-To: <20260806014813.1587003-1-daeho43@gmail.com>

Le 06/08/2026 à 03:48, Daeho Jeong a écrit :
> From: Daeho Jeong <daehojeong@google.com>
> 
> This patch adds a dynamic management feature to the existing device
> aliasing functionality. It allows users to dynamically reserve or
> release specific devices from the filesystem's free pool at runtime
> through new ioctls.
> 
> To support this, three new ioctls are introduced:
> - F2FS_IOC_RESERVE_DEV_ALIAS: This reclaims the space occupied by a
>    device aliasing file. It first performs a capacity check, resets GC
>    victim information for the target range, marks the segments as in-use
>    to prevent new allocations, and then triggers GC to migrate existing
>    valid data out of the range. Finally, it reserves these blocks in the
>    SIT to effectively exclude the device from the usable capacity.
> 
> - F2FS_IOC_RELEASE_DEV_ALIAS: This releases the reserved space of a
>    previously reserved device aliasing file. It truncates the blocks
>    associated with the file, which makes them available for general
>    filesystem allocation again.
> 
> - F2FS_IOC_GET_DEV_ALIAS_STATUS: This retrieves the current aliasing
>    status of a device aliasing file, returning whether the file is
>    released (inactive alias) or reserved (active alias, with blocks
>    fully allocated on the device).
> 
> Signed-off-by: Daeho Jeong <daehojeong@google.com>

Hi,

this patch has already reached -next, but 2 comments below, should they 
make any sense.

> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
> index cac03b8e91a1..8c3b57987f6c 100644
> --- a/fs/f2fs/namei.c
> +++ b/fs/f2fs/namei.c
> @@ -425,6 +425,9 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
>   	if (!f2fs_is_checkpoint_ready(sbi))
>   		return -ENOSPC;
>   
> +	if (IS_DEVICE_ALIASING(inode))
> +		return -EPERM;
> +
>   	err = fscrypt_prepare_link(old_dentry, dir, dentry);
>   	if (err)
>   		return err;
> @@ -568,6 +571,9 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
>   
>   	trace_f2fs_unlink_enter(dir, dentry);
>   
> +	if (IS_DEVICE_ALIASING(inode))
> +		return -EPERM;
> +

Based on surrounding goto, should this one be:
    err = -EPERM
    goto out;
?

>   	if (unlikely(f2fs_cp_error(sbi))) {
>   		err = -EIO;
>   		goto out;
> @@ -946,6 +952,9 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
>   	bool old_is_dir = S_ISDIR(old_inode->i_mode);
>   	int err;
>   
> +	if (IS_DEVICE_ALIASING(old_inode))
> +		return -EPERM;
> +
>   	if (unlikely(f2fs_cp_error(sbi)))
>   		return -EIO;
>   	if (!f2fs_is_checkpoint_ready(sbi))
> @@ -1016,6 +1025,8 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
>   	}
>   
>   	if (new_inode) {
> +		if (IS_DEVICE_ALIASING(new_inode))
> +			return -EPERM;

Based on surrounding goto, should this one be:
    err = -EPERM
    goto out_dir;
?

>   
>   		err = -ENOTEMPTY;
>   		if (old_is_dir && !f2fs_empty_dir(new_inode))
> @@ -1143,6 +1154,9 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
>   	int old_nlink = 0, new_nlink = 0;
>   	int err;
>   
> +	if (IS_DEVICE_ALIASING(old_inode) || IS_DEVICE_ALIASING(new_inode))
> +		return -EPERM;
> +
>   	if (unlikely(f2fs_cp_error(sbi)))
>   		return -EIO;
>   	if (!f2fs_is_checkpoint_ready(sbi))
[...]

CJ

  parent reply	other threads:[~2026-08-20 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  1:48 Daeho Jeong
2026-08-06  2:43 ` [f2fs-dev] " Chao Yu
2026-08-11  4:30 ` patchwork-bot+f2fs
2026-08-20 20:30 ` Christophe JAILLET [this message]
2026-08-20 21:01   ` Daeho Jeong

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=ccec912d-5d80-4f9d-bdb2-c07a16c72b46@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --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 \
    /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

all inboxes | Powered by JetHome®