mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 11:44:01 +08:00
btrfs: return error instead of crash when detecting unexpected type in btrfs_get_acl
The caller of btrfs_get_acl() checks error condition so there is no impact from this change. In practice there is no chance to get into default case of switch statement because VFS has already checked the type. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
af431dcb24
commit
ab3629ed86
@ -30,7 +30,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
|
|||||||
name = XATTR_NAME_POSIX_ACL_DEFAULT;
|
name = XATTR_NAME_POSIX_ACL_DEFAULT;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BUG();
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
size = btrfs_getxattr(inode, name, "", 0);
|
size = btrfs_getxattr(inode, name, "", 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user