btrfs: Deprecate userspace transaction ioctls
[sfrench/cifs-2.6.git] / fs / btrfs / ioctl.c
index 496e873b14de4a8e3257fe75fb75dcaf8f2ef588..4cfc3d4c0a3720ca1564eb14cb063db26bc017e1 100644 (file)
@@ -3967,11 +3967,22 @@ static long btrfs_ioctl_trans_start(struct file *file)
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_trans_handle *trans;
        int ret;
+       static bool warned = false;
 
        ret = -EPERM;
        if (!capable(CAP_SYS_ADMIN))
                goto out;
 
+       if (!warned) {
+               btrfs_warn(fs_info,
+                       "Userspace transaction mechanism is considered "
+                       "deprecated and slated to be removed in 4.17. "
+                       "If you have a valid use case please "
+                       "speak up on the mailing list");
+               WARN_ON(1);
+               warned = true;
+       }
+
        ret = -EINPROGRESS;
        if (file->private_data)
                goto out;