mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	btrfs: Deprecate userspace transaction ioctls
Userspace transactions were introduced in commit 6bf13c0cc8 ("Btrfs:
transaction ioctls") to provide semantics that Ceph's object store
required. However, things have changed significantly since then, to the
point where btrfs is no longer suitable as a backend for ceph and in
fact it's actively advised against such usages. Considering this, there
doesn't seem to be a widespread, legit use case of userspace
transaction. They also clutter the file->private pointer.
So to end the agony let's nuke the userspace transaction ioctls. As a
first step let's give time for people to voice their objection by just
WARN()ining when the userspace transaction is used.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ move the warning past perm checks, keep the has-been-printed state;
  we're ok with just one warning over all filesystems ]
Signed-off-by: David Sterba <dsterba@suse.com>
			
			
This commit is contained in:
		
							parent
							
								
									9f6d251033
								
							
						
					
					
						commit
						3558d4f88e
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue