mirror of
https://github.com/ceph/ceph
synced 2025-03-30 07:19:14 +00:00
mds: always store backtrace xattr in the default pool
when creating file in non-default pool, we need to store a backtrace in the default pool in addition to the specified pool. Otherwise the 'lookup-by-ino' function will consider backtrace for file is missing. Fixes: #6914 Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
This commit is contained in:
parent
21a64c172c
commit
f292992b82
@ -1035,7 +1035,7 @@ void CInode::store_backtrace(Context *fin)
|
||||
object_locator_t oloc(pool);
|
||||
Context *fin2 = new C_Inode_StoredBacktrace(this, inode.backtrace_version, fin);
|
||||
|
||||
if (!state_test(STATE_DIRTYPOOL)) {
|
||||
if (!state_test(STATE_DIRTYPOOL) || inode.old_pools.empty()) {
|
||||
mdcache->mds->objecter->mutate(oid, oloc, op, snapc, ceph_clock_now(g_ceph_context),
|
||||
0, NULL, fin2);
|
||||
return;
|
||||
|
@ -8499,7 +8499,7 @@ void MDCache::open_ino(inodeno_t ino, int64_t pool, Context* fin,
|
||||
info.want_replica = want_replica;
|
||||
info.want_xlocked = want_xlocked;
|
||||
info.tid = ++open_ino_last_tid;
|
||||
info.pool = pool >= 0 ? pool : mds->mdsmap->get_first_data_pool();
|
||||
info.pool = pool >= 0 ? pool : default_file_layout.fl_pg_pool;
|
||||
info.waiters.push_back(fin);
|
||||
do_open_ino(ino, info, 0);
|
||||
}
|
||||
|
@ -2582,7 +2582,7 @@ public:
|
||||
// dirty inode, dn, dir
|
||||
newi->inode.version--; // a bit hacky, see C_MDS_mknod_finish
|
||||
newi->mark_dirty(newi->inode.version+1, mdr->ls);
|
||||
newi->_mark_dirty_parent(mdr->ls);
|
||||
newi->_mark_dirty_parent(mdr->ls, true);
|
||||
|
||||
mdr->apply();
|
||||
|
||||
@ -2714,6 +2714,8 @@ void Server::handle_client_openc(MDRequest *mdr)
|
||||
dn->push_projected_linkage(in);
|
||||
|
||||
in->inode.version = dn->pre_dirty();
|
||||
if (layout.fl_pg_pool != mdcache->default_file_layout.fl_pg_pool)
|
||||
in->inode.add_old_pool(mdcache->default_file_layout.fl_pg_pool);
|
||||
in->inode.update_backtrace();
|
||||
if (cmode & CEPH_FILE_MODE_WR) {
|
||||
in->inode.client_ranges[client].range.first = 0;
|
||||
@ -2733,7 +2735,7 @@ void Server::handle_client_openc(MDRequest *mdr)
|
||||
le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
|
||||
journal_allocated_inos(mdr, &le->metablob);
|
||||
mdcache->predirty_journal_parents(mdr, &le->metablob, in, dn->get_dir(), PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
|
||||
le->metablob.add_primary_dentry(dn, in, true, true);
|
||||
le->metablob.add_primary_dentry(dn, in, true, true, true);
|
||||
|
||||
// do the open
|
||||
mds->locker->issue_new_caps(in, cmode, mdr->session, realm, req->is_replay());
|
||||
@ -3893,7 +3895,7 @@ public:
|
||||
// a new version of hte inode since it's just been created)
|
||||
newi->inode.version--;
|
||||
newi->mark_dirty(newi->inode.version + 1, mdr->ls);
|
||||
newi->_mark_dirty_parent(mdr->ls);
|
||||
newi->_mark_dirty_parent(mdr->ls, true);
|
||||
|
||||
// mkdir?
|
||||
if (newi->inode.is_dir()) {
|
||||
@ -3968,6 +3970,8 @@ void Server::handle_client_mknod(MDRequest *mdr)
|
||||
newi->inode.mode |= S_IFREG;
|
||||
newi->inode.version = dn->pre_dirty();
|
||||
newi->inode.rstat.rfiles = 1;
|
||||
if (layout.fl_pg_pool != mdcache->default_file_layout.fl_pg_pool)
|
||||
newi->inode.add_old_pool(mdcache->default_file_layout.fl_pg_pool);
|
||||
newi->inode.update_backtrace();
|
||||
|
||||
// if the client created a _regular_ file via MKNOD, it's highly likely they'll
|
||||
@ -4009,7 +4013,7 @@ void Server::handle_client_mknod(MDRequest *mdr)
|
||||
|
||||
mdcache->predirty_journal_parents(mdr, &le->metablob, newi, dn->get_dir(),
|
||||
PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
|
||||
le->metablob.add_primary_dentry(dn, newi, true, true);
|
||||
le->metablob.add_primary_dentry(dn, newi, true, true, true);
|
||||
|
||||
journal_and_reply(mdr, newi, dn, le, new C_MDS_mknod_finish(mds, mdr, dn, newi, follows));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user