From: xie xingguo Date: Tue, 14 Jun 2016 11:32:01 +0000 (+0800) Subject: server: negative error code when responding to client X-Git-Tag: v10.2.8~128^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13831%2Fhead;p=ceph.git server: negative error code when responding to client 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 (cherry picked from commit 26931f888ce4661765cca106b3a3dc66702266df) Signed-off-by: Jan Fajerski --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 6160bce430f2..56e93107214b 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2946,7 +2946,7 @@ void Server::handle_client_open(MDRequestRef& mdr) 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; }