btrfs: call permission checks earlier in ioctls and return EPERM
authorDavid Sterba <dsterba@suse.cz>
Thu, 16 Jan 2014 14:50:22 +0000 (15:50 +0100)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:20:41 +0000 (13:20 -0800)
commitbd60ea0fe947029df4b7b7aa9d6557baf2a5a138
tree572b5d652fb6a4c2977bfbc1cc26dac8e3f79d89
parentd024206133ce21936b3d5780359afc00247655b7
btrfs: call permission checks earlier in ioctls and return EPERM

The owner and capability checks in IOC_SUBVOL_SETFLAGS and
SET_RECEIVED_SUBVOL should be called before any other checks are done.

Also unify the error code to EPERM.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ioctl.c