Skip to contentSkip to conversation

Btrfs: disable qgroup id 0

PATCH New Miao Xie 1 participant 1 message Nov 15, 2012 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH 1/1 Btrfs: disable qgroup id 0

Qgroup id 0 is a special number, we should set the id of a qgroup to 0. Fix it.

---
 fs/btrfs/ioctl.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/btrfs/ioctl.c +5 -0
index 8e5b7fa..922a33a 100644
@@ -3574,6 +3574,11 @@ static long btrfs_ioctl_qgroup_create(struct btrfs_root *root, void __user *arg)
 	if (IS_ERR(sa))
 		return PTR_ERR(sa);
 
+	if (!sa->qgroupid) {
+		ret = -EINVAL;
+		goto out;
+	}
+
 	trans = btrfs_join_transaction(root);
 	if (IS_ERR(trans)) {
 		ret = PTR_ERR(trans);
Signature · 1 line
1.7.11.7