Skip to contentSkip to conversation

btrfs: Deprecate BTRFS_IOC_BALANCE ioctl

PATCH In review Nikolay Borisov 4 participants 5 messages Nov 10, 2021 – Nov 11, 2021 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: Deprecate BTRFS_IOC_BALANCE ioctl

The v2 balance ioctl has been introduced more than 9 years ago. Users of the old v1 ioctl should have long been migrated to it. It's time we deprecate it and eventually remove it.

---
 fs/btrfs/ioctl.c | 3 +++
 1 file changed, 3 insertions(+)
fs/btrfs/ioctl.c +3 -0
index 238308f14474..dcf0772880b6 100644
@@ -4013,6 +4013,9 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg)
 	bool need_unlock; /* for mut. excl. ops lock */
 	int ret;
 
+	if (!arg)
+		btrfs_warn(fs_info, "BTRFS_IOC_BALANCE ioctl is deprecated and will be removed in kernel 5.18");
+
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
Signature · 1 line
2.25.1
#2 lore raw
In reply to Nikolay Borisov
Quoted 3 lines · Nikolay Borisov

The v2 balance ioctl has been introduced more than 9 years ago. Users of the old v1 ioctl should have long been migrated to it. It's time we deprecate it and eventually remove it.

Agreed. I maybe put this patch to the 5.16 queue, there's not much reason to delay it and it's not a functional change.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Nikolay Borisov
Quoted 5 lines · Nikolay Borisov

The v2 balance ioctl has been introduced more than 9 years ago. Users of the old v1 ioctl should have long been migrated to it. It's time we deprecate it and eventually remove it.

fs/btrfs/ioctl.c static long btrfs_ioctl_balance(struct file *file, void __user *arg) · line 4018

Quoted 3 lines
fs/btrfs/ioctl.c +3 -0
+	if (!arg)
+		btrfs_warn(fs_info, "BTRFS_IOC_BALANCE ioctl is deprecated and will be removed in kernel 5.18");
+

Nit:
Needs proper formatting, split into two lines, adjust the indent if still longer than 80 char.

Thanks, Anand