From: Boris Burkov <boris@bur.io>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 1/2] btrfs: forbid creating subvol qgroups
Date: Fri, 19 Jan 2024 16:55:58 -0800 [thread overview]
Message-ID: <eb79dcbe0cbfa7459b249f76818a5e5a08a42ea4.1705711967.git.boris@bur.io> (raw)
In-Reply-To: <cover.1705711967.git.boris@bur.io>
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>
---
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);
--
2.43.0
next prev parent reply other threads:[~2024-01-20 0:55 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 ` Boris Burkov [this message]
2024-01-20 2:57 ` [PATCH 1/2] btrfs: forbid creating subvol qgroups Qu Wenruo
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=eb79dcbe0cbfa7459b249f76818a5e5a08a42ea4.1705711967.git.boris@bur.io \
--to=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