public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Boris Burkov <boris@bur.io>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 1/2] btrfs: forbid creating subvol qgroups
Date: Sat, 20 Jan 2024 13:27:47 +1030	[thread overview]
Message-ID: <34a8f0b0-8235-40ea-bf11-8d29d987d9c6@gmx.com> (raw)
In-Reply-To: <eb79dcbe0cbfa7459b249f76818a5e5a08a42ea4.1705711967.git.boris@bur.io>



On 2024/1/20 11:25, Boris Burkov wrote:
> This leads to various races and it isn't helpful, because you can't
> specify a subvol id when creating a subvol, so you can't be sure it
> will be the right one. Any requirements on the automatic subvol can
> be gratified by using a higher level qgroup and the inheritance
> parameters of subvol creation.
>
> Signed-off-by: Boris Burkov <boris@bur.io>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/ioctl.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 58e0c59bc4cd..3d476decde52 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -3815,6 +3815,11 @@ static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg)
>   		goto out;
>   	}
>
> +	if (sa->create && is_fstree(sa->qgroupid)) {
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
>   	trans = btrfs_join_transaction(root);
>   	if (IS_ERR(trans)) {
>   		ret = PTR_ERR(trans);

  reply	other threads:[~2024-01-20  2:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20  0:55 [PATCH 0/2] btrfs: subvol qgroup lifetime invariants Boris Burkov
2024-01-20  0:55 ` [PATCH 1/2] btrfs: forbid creating subvol qgroups Boris Burkov
2024-01-20  2:57   ` Qu Wenruo [this message]
2024-01-22 20:43   ` David Sterba
2024-01-24 12:52   ` Neal Gompa
2024-01-24 16:36     ` David Sterba
2024-01-25  3:32       ` Neal Gompa
2024-01-25 23:12         ` Boris Burkov
2024-01-26 15:50           ` Neal Gompa
2024-01-20  0:55 ` [PATCH 2/2] btrfs: forbid deleting live subvol qgroup Boris Burkov
2024-01-20  2:58   ` Qu Wenruo
2024-01-22 20:43   ` David Sterba

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=34a8f0b0-8235-40ea-bf11-8d29d987d9c6@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=boris@bur.io \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@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