bool MDCache::can_fragment(CInode *diri, list<CDir*>& dirs)
{
+ if (is_readonly()) {
+ dout(7) << "can_fragment: read-only FS, no fragmenting for now" << dendl;
+ return false;
+ }
if (mds->mdsmap->is_degraded()) {
dout(7) << "can_fragment: cluster degraded, no fragmenting for now" << dendl;
return false;
void eval_remote(CDentry *dn);
void maybe_eval_stray(CInode *in, bool delay=false) {
- if (in->inode.nlink > 0 || in->is_base())
+ if (in->inode.nlink > 0 || in->is_base() || is_readonly())
return;
CDentry *dn = in->get_projected_parent_dn();
if (!dn->state_test(CDentry::STATE_PURGING) &&
assert(dir->is_auth());
assert(dest != mds->get_nodeid());
+ if (mds->mdcache->is_readonly()) {
+ dout(7) << "read-only FS, no exports for now" << dendl;
+ return;
+ }
if (mds->mdsmap->is_degraded()) {
dout(7) << "cluster degraded, no exports for now" << dendl;
return;
dout(7) << " all ready, noting auth and freezing import region" << dendl;
bool success = true;
- if (dir->get_inode()->filelock.can_wrlock(-1) &&
+ if (!mds->mdcache->is_readonly() &&
+ dir->get_inode()->filelock.can_wrlock(-1) &&
dir->get_inode()->nestlock.can_wrlock(-1)) {
it->second.mut = MutationRef(new MutationImpl);
// force some locks. hacky.