From 26931f888ce4661765cca106b3a3dc66702266df 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 --- 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 e7ef6251d84..0df703b0adf 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2927,7 +2927,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