As the comment suggests. Also a zero or positive return code
shall indicates a success, which does not match our intention here.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit
26931f888ce4661765cca106b3a3dc66702266df)
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
if ((flags & O_TRUNC) && !cur->inode.is_file()) {
dout(7) << "specified O_TRUNC on !(file|symlink) " << *cur << dendl;
// we should return -EISDIR for directory, return -EINVAL for other non-regular
- respond_to_request(mdr, cur->inode.is_dir() ? EISDIR : -EINVAL);
+ respond_to_request(mdr, cur->inode.is_dir() ? -EISDIR : -EINVAL);
return;
}