diff options
author | Chengguang Xu <cgxu519@gmx.com> | 2018-06-27 07:16:34 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 14:12:40 +0300 |
commit | ab3629ed86ec43e7d95cf087d0b5a9d403fcd822 (patch) | |
tree | 45fb7a3623160b31e26cfd7e5732226404641aee /fs/btrfs/acl.c | |
parent | af431dcb249ffff20b16e08adaa4b624405a046b (diff) | |
download | linux-ab3629ed86ec43e7d95cf087d0b5a9d403fcd822.tar.xz |
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>
Diffstat (limited to 'fs/btrfs/acl.c')
-rw-r--r-- | fs/btrfs/acl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 15e1dfef56a5..60f83a3bd77c 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c @@ -30,7 +30,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type) name = XATTR_NAME_POSIX_ACL_DEFAULT; break; default: - BUG(); + return ERR_PTR(-EINVAL); } size = btrfs_getxattr(inode, name, "", 0); |