mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	btrfs: use GFP_KERNEL for xattr and acl allocations
We don't have to use GFP_NOFS in context of ACL or XATTR actions, not possible to loop through the allocator and it's safe to fail with ENOMEM. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									61dd5ae65b
								
							
						
					
					
						commit
						39a27ec100
					
				
					 2 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -48,7 +48,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	size = __btrfs_getxattr(inode, name, "", 0);
 | 
						size = __btrfs_getxattr(inode, name, "", 0);
 | 
				
			||||||
	if (size > 0) {
 | 
						if (size > 0) {
 | 
				
			||||||
		value = kzalloc(size, GFP_NOFS);
 | 
							value = kzalloc(size, GFP_KERNEL);
 | 
				
			||||||
		if (!value)
 | 
							if (!value)
 | 
				
			||||||
			return ERR_PTR(-ENOMEM);
 | 
								return ERR_PTR(-ENOMEM);
 | 
				
			||||||
		size = __btrfs_getxattr(inode, name, value, size);
 | 
							size = __btrfs_getxattr(inode, name, value, size);
 | 
				
			||||||
| 
						 | 
					@ -102,7 +102,7 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (acl) {
 | 
						if (acl) {
 | 
				
			||||||
		size = posix_acl_xattr_size(acl->a_count);
 | 
							size = posix_acl_xattr_size(acl->a_count);
 | 
				
			||||||
		value = kmalloc(size, GFP_NOFS);
 | 
							value = kmalloc(size, GFP_KERNEL);
 | 
				
			||||||
		if (!value) {
 | 
							if (!value) {
 | 
				
			||||||
			ret = -ENOMEM;
 | 
								ret = -ENOMEM;
 | 
				
			||||||
			goto out;
 | 
								goto out;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -494,7 +494,7 @@ static int btrfs_initxattrs(struct inode *inode,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (xattr = xattr_array; xattr->name != NULL; xattr++) {
 | 
						for (xattr = xattr_array; xattr->name != NULL; xattr++) {
 | 
				
			||||||
		name = kmalloc(XATTR_SECURITY_PREFIX_LEN +
 | 
							name = kmalloc(XATTR_SECURITY_PREFIX_LEN +
 | 
				
			||||||
			       strlen(xattr->name) + 1, GFP_NOFS);
 | 
								       strlen(xattr->name) + 1, GFP_KERNEL);
 | 
				
			||||||
		if (!name) {
 | 
							if (!name) {
 | 
				
			||||||
			err = -ENOMEM;
 | 
								err = -ENOMEM;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue