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

os/bluestore: flush before enumerating omap values #12328

Merged
merged 1 commit into from Dec 6, 2016
Merged
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
4 changes: 4 additions & 0 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -8263,6 +8263,7 @@ int BlueStore::_do_remove(
if (r < 0)
return r;
if (o->onode.has_omap()) {
o->flush();
_do_omap_clear(txc, o->onode.nid);
}
o->exists = false;
Expand Down Expand Up @@ -8397,6 +8398,7 @@ int BlueStore::_omap_clear(TransContext *txc,
dout(15) << __func__ << " " << c->cid << " " << o->oid << dendl;
int r = 0;
if (o->onode.has_omap()) {
o->flush();
_do_omap_clear(txc, o->onode.nid);
o->onode.clear_omap_flag();
txc->write_onode(o);
Expand Down Expand Up @@ -8501,6 +8503,7 @@ int BlueStore::_omap_rmkey_range(TransContext *txc,
if (!o->onode.has_omap()) {
goto out;
}
o->flush();
Copy link
Member

Choose a reason for hiding this comment

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

Update _omap_rmkeys() too?

it = db->get_iterator(PREFIX_OMAP);
get_omap_key(o->onode.nid, first, &key_first);
get_omap_key(o->onode.nid, last, &key_last);
Expand Down Expand Up @@ -8587,6 +8590,7 @@ int BlueStore::_clone(TransContext *txc,
// clone omap
if (newo->onode.has_omap()) {
dout(20) << __func__ << " clearing old omap data" << dendl;
newo->flush();
_do_omap_clear(txc, newo->onode.nid);
}
if (oldo->onode.has_omap()) {
Expand Down