]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
server: negative error code when responding to client 13831/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 14 Jun 2016 11:32:01 +0000 (19:32 +0800)
committerJan Fajerski <jfajerski@suse.com>
Tue, 7 Mar 2017 13:38:36 +0000 (14:38 +0100)
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>
src/mds/Server.cc

index 6160bce430f2cc9e28ba8fbd8553133471424dda..56e93107214bbcb7c3bc2c6cf6ee17d66fd8eb64 100644 (file)
@@ -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;
   }