Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mds: handle rctime updates for snaps #42894

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mds/Locker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3913,6 +3913,7 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
wrlock_force(&in->xattrlock, mut);
}

dout(20) << "rctime projections must stop at:" << follows << dendl;
mut->auth_pin(in);
mdcache->predirty_journal_parents(mut, &le->metablob, in, 0, PREDIRTY_PRIMARY, 0, follows);
mdcache->journal_dirty_inode(mut.get(), &le->metablob, in, follows);
Expand Down
9 changes: 7 additions & 2 deletions src/mds/MDCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2000,14 +2000,19 @@ void MDCache::project_rstat_frag_to_inode(const nest_info_t& rstat,
(*_old_inodes)[last].first = first = ofirst;
}
pi = &(*_old_inodes)[last].inode;
pin->dirty_old_rstats.insert(last);
if (pi->btime >= rstat.rctime) {
pin->dirty_old_rstats.insert(last);
} else {
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation looks really weird.

Copy link
Contributor Author

@mchangir mchangir Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's probably how the TAB character is emulated by the web browser code display component
things look okay in the code (Vim editor)

}
dout(20) << " projecting to [" << first << "," << last << "] " << pi->rstat << dendl;
pi->rstat.add(delta);
dout(20) << " result [" << first << "," << last << "] " << pi->rstat << dendl;

last = first-1;
}
dout(20) << "projections stopped at:" << last << dendl;
if (_old_inodes)
pin->reset_old_inodes(std::move(_old_inodes));
}
Expand Down Expand Up @@ -2334,7 +2339,7 @@ void MDCache::predirty_journal_parents(MutationRef mut, EMetaBlob *blob,
}
}
parent->dirty_old_rstat.clear();
project_rstat_frag_to_inode(pf->rstat, pf->accounted_rstat, parent->first, CEPH_NOSNAP, pin, true);//false);
project_rstat_frag_to_inode(pf->rstat, pf->accounted_rstat, parent->first, CEPH_NOSNAP, pin, true);

pf->accounted_rstat = pf->rstat;

Expand Down