mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	btrfs: remove redundant readonly root check in btrfs_setxattr_trans
btrfs_setxattr_trans() is called by 5 functions as below and all of them
do updates. None of them would be roun on a read-only root.
So its ok to remove the readonly root check here as it's a high-level
conditon.
1.
  __btrfs_set_acl()
    btrfs_init_acl()
      btrfs_init_inode_security()
2.
  __btrfs_set_acl()
    btrfs_set_acl()
3.
  btrfs_set_prop()
    btrfs_set_prop_trans()
      /                       \
      btrfs_ioctl_setflags()   btrfs_xattr_handler_set_prop()
4.
  btrfs_xattr_handler_set()
5.
  btrfs_initxattrs()
    btrfs_xattr_security_init()
      btrfs_init_inode_security()
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
			
			
This commit is contained in:
		
							parent
							
								
									3e125a74fb
								
							
						
					
					
						commit
						353c2ea735
					
				
					 1 changed files with 0 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -226,9 +226,6 @@ int btrfs_setxattr_trans(struct btrfs_trans_handle *trans,
 | 
			
		|||
	struct btrfs_root *root = BTRFS_I(inode)->root;
 | 
			
		||||
	int ret;
 | 
			
		||||
 | 
			
		||||
	if (btrfs_root_readonly(root))
 | 
			
		||||
		return -EROFS;
 | 
			
		||||
 | 
			
		||||
	if (trans)
 | 
			
		||||
		return btrfs_setxattr(trans, inode, name, value, size, flags);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue