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: v10.2.3~32^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3af7b422a3a97c0e89dbff757c5ed0f4557a6602;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 313744718b0b..16424671dfbc 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2893,8 +2893,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