]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: properly set default dir_hash for directory inodes 13227/head
authorYan, Zheng <zyan@redhat.com>
Mon, 20 Feb 2017 03:27:09 +0000 (11:27 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 20 Feb 2017 08:12:36 +0000 (16:12 +0800)
MDCache::handle_cache_rejoin_strong(). may add new inodes (race with
cache expire). Updating these inodes is at the very end of the function.
Before these inodes get updated, MDCache::handle_cache_rejoin_strong()
may add dentries to these inodes. So dir_hash type of these inodes
should be set to the default value.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/MDCache.cc

index adc77de693348fdf0c78aedcb2344159e71707dd..84bba81b64ea87c013322d39a1352adaadc208e7 100644 (file)
@@ -4900,6 +4900,7 @@ void MDCache::handle_cache_rejoin_ack(MMDSCacheRejoin *ack)
        diri = new CInode(this, false);
        diri->inode.ino = p->first.ino;
        diri->inode.mode = S_IFDIR;
+       diri->inode.dir_layout.dl_dir_hash = g_conf->mds_default_dir_hash;
        add_inode(diri);
        if (MDS_INO_MDSDIR(from) == p->first.ino) {
          diri->inode_auth = mds_authority_t(from, CDIR_AUTH_UNKNOWN);
@@ -4971,6 +4972,7 @@ void MDCache::handle_cache_rejoin_ack(MMDSCacheRejoin *ack)
            in = new CInode(this, false, q->second.first, q->first.snapid);
            in->inode.ino = q->second.ino;
            in->inode.mode = S_IFDIR;
+           in->inode.dir_layout.dl_dir_hash = g_conf->mds_default_dir_hash;
            add_inode(in);
            dout(10) << " add inode " << *in << dendl;
          } else if (in->get_parent_dn()) {