From: Yan, Zheng Date: Fri, 15 Apr 2016 11:45:23 +0000 (+0800) Subject: mds: only open non-regular inode with mode FILE_MODE_PIN X-Git-Tag: v0.94.8~18^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f0fb20ed08dfde614cff6c056d41b59af200c2c;p=ceph.git mds: only open non-regular inode with mode FILE_MODE_PIN ceph_atomic_open() in kernel client does lookup and open at the same time. So it can open a symlink inode with mode CEPH_FILE_MODE_WR. Open a symlink inode with mode CEPH_FILE_MODE_WR triggers assertion in Locker::check_inode_max_size(); Signed-off-by: Yan, Zheng (cherry picked from commit 4d15eb12298e007744486e28924a6f0ae071bd06) --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index d4ed0723962f..3b1426958c3b 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2732,8 +2732,8 @@ void Server::handle_client_open(MDRequestRef& mdr) return; } - // can only open a dir with mode FILE_MODE_PIN, at least for now. - if (cur->inode.is_dir()) + // can only open non-regular inode with mode FILE_MODE_PIN, at least for now. + if (!cur->inode.is_file()) cmode = CEPH_FILE_MODE_PIN; dout(10) << "open flags = " << flags