On Fri, May 11, 2018 at 12:26:51PM -0700, Mark Fasheh wrote: > Right now we return EINVAL if a process does not have permission to dedupe a > file. This was an oversight on my part. EPERM gives a true description of > the nature of our error, and EINVAL is already used for the case that the > filesystem does not support dedupe. > > Signed-off-by: Mark Fasheh <mfasheh@xxxxxxx> Acked-by: David Sterba <dsterba@xxxxxxxx> We've been using EINVAL when the request is invalid in the ioctls, eg. combination of arguments that does not make sense, while EPERM is for cases when the request is ok but there's still some permission missing, > } else if (!(is_admin || (dst_file->f_mode & FMODE_WRITE) || > uid_eq(current_fsuid(), dst->i_uid))) { > - info->status = -EINVAL; > + info->status = -EPERM; exactly like this.