From f6076dd0416dd4464955f208d8964ef136b6142b Mon Sep 17 00:00:00 2001 From: Zhi Zhang Date: Tue, 3 May 2016 17:12:26 +0800 Subject: [PATCH] mds: wrongly treat symlink inode as normal file/dir when symlink inode is stale on kcephfs Signed-off-by: Zhi Zhang (cherry picked from commit 88b6d669e37924536152a552db46ef43a7353562) Conflicts: src/mds/Server.cc (hammer has req->head.args.open.flags instead of just flags) --- 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 d4ed0723962f6..dc9a994b8e935 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2747,7 +2747,7 @@ void Server::handle_client_open(MDRequestRef& mdr) respond_to_request(mdr, -ENXIO); // FIXME what error do we want? return; }*/ - if ((req->head.args.open.flags & O_DIRECTORY) && !cur->inode.is_dir()) { + if ((req->head.args.open.flags & O_DIRECTORY) && !cur->inode.is_dir() && !cur->inode.is_symlink()) { dout(7) << "specified O_DIRECTORY on non-directory " << *cur << dendl; respond_to_request(mdr, -EINVAL); return;