Skip to contentSkip to conversation

Btrfs: creating the subvolume qgroup automatically when enabling quota

PATCH Superseded Wang Shilong 1 participant 1 message Mar 21, 2013 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: creating the subvolume qgroup automatically when enabling quota

From: Wang Shilong <[email protected]>

Creating the subvolume/snapshots(including root subvolume) qgroup auotomatically when enabling quota.

---
 fs/btrfs/ioctl.c  |    2 +
 fs/btrfs/qgroup.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 0 deletions(-)
fs/btrfs/ioctl.c +2 -0
index 2c02310..222ce84 100644
@@ -3693,6 +3693,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
 		goto drop_write;
 	}
 
+	down_read(&root->fs_info->subvol_sem);
 	if (sa->cmd != BTRFS_QUOTA_CTL_RESCAN) {
 		trans = btrfs_start_transaction(root, 2);
 		if (IS_ERR(trans)) {
@@ -3726,6 +3727,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
 	}
 out:
 	kfree(sa);
+	up_read(&root->fs_info->subvol_sem);
 drop_write:
 	mnt_drop_write_file(file);
 	return ret;
fs/btrfs/qgroup.c +55 -0

73 lines not on this page · raw message

Signature · 1 line
1.7.7.6