Skip to content

Commit

Permalink
Merge pull request #7431: infernalis : Ceph file system is not freein…
Browse files Browse the repository at this point in the history
…g space

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
Loic Dachary committed Feb 8, 2016
2 parents 5ff4eef + 29d30ec commit 9348fd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/mds/MDCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6622,12 +6622,6 @@ void MDCache::trim_non_auth()
if (dnl->is_remote() && dnl->get_inode() && !dnl->get_inode()->is_auth())
dn->unlink_remote(dnl);

if (dn->get_dir()->get_inode()->is_stray()) {
dn->state_set(CDentry::STATE_STRAY);
if (dnl->is_primary() && dnl->get_inode()->inode.nlink == 0)
dnl->get_inode()->state_set(CInode::STATE_ORPHAN);
}

if (!first_auth) {
first_auth = dn;
} else {
Expand Down Expand Up @@ -9185,10 +9179,14 @@ void MDCache::scan_stray_dir(dirfrag_t next)
}
for (CDir::map_t::iterator q = dir->items.begin(); q != dir->items.end(); ++q) {
CDentry *dn = q->second;
dn->state_set(CDentry::STATE_STRAY);
CDentry::linkage_t *dnl = dn->get_projected_linkage();
stray_manager.notify_stray_created();
if (dnl->is_primary()) {
maybe_eval_stray(dnl->get_inode());
CInode *in = dnl->get_inode();
if (in->inode.nlink == 0)
in->state_set(CInode::STATE_ORPHAN);
maybe_eval_stray(in);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/mon/MonCap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ void MonCapGrant::expand_profile(EntityName name) const
profile_grants.push_back(MonCapGrant("mds", MON_CAP_ALL));
profile_grants.push_back(MonCapGrant("mon", MON_CAP_R));
profile_grants.push_back(MonCapGrant("osd", MON_CAP_R));
// This command grant is checked explicitly in MRemoveSnaps handling
profile_grants.push_back(MonCapGrant("osd pool rmsnap"));
profile_grants.push_back(MonCapGrant("log", MON_CAP_W));
}
if (profile == "osd" || profile == "mds" || profile == "mon") {
Expand Down
3 changes: 2 additions & 1 deletion src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,8 @@ bool OSDMonitor::preprocess_remove_snaps(MonOpRequestRef op)
MonSession *session = m->get_session();
if (!session)
goto ignore;
if (!session->is_capable("osd", MON_CAP_R | MON_CAP_W)) {
if (!session->caps.is_capable(g_ceph_context, session->entity_name,
"osd", "osd pool rmsnap", {}, true, true, false)) {
dout(0) << "got preprocess_remove_snaps from entity with insufficient caps "
<< session->caps << dendl;
goto ignore;
Expand Down

0 comments on commit 9348fd9

Please sign in to comment.