]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: only open non-regular inode with mode FILE_MODE_PIN
authorYan, Zheng <zyan@redhat.com>
Fri, 15 Apr 2016 11:45:23 +0000 (19:45 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 8 Jul 2016 07:23:55 +0000 (09:23 +0200)
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 <zyan@redhat.com>
(cherry picked from commit 4d15eb12298e007744486e28924a6f0ae071bd06)

src/mds/Server.cc

index d4ed0723962f6e1cddfe3d02131c6f405ead3292..3b1426958c3b2e0b2886ff666fa13aecff1c6cef 100644 (file)
@@ -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