From 714eb863c30df4e653068e6ea16630504e58b704 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 14 Jun 2016 19:32:01 +0800 Subject: [PATCH] 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 --- src/mds/Server.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.3