Skip to content

Commit

Permalink
mds: only open non-regular inode with mode FILE_MODE_PIN
Browse files Browse the repository at this point in the history
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 4d15eb1)
  • Loading branch information
ukernel authored and smithfarm committed Jul 8, 2016
1 parent 387d5c1 commit 3f0fb20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mds/Server.cc
Expand Up @@ -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
Expand Down

0 comments on commit 3f0fb20

Please sign in to comment.