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

osd: bluestore: fix bluestore onode_t attr leak #7125

Merged
merged 1 commit into from Jan 11, 2016
Merged
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/include/buffer.h
Expand Up @@ -197,6 +197,7 @@ namespace buffer CEPH_BUFFER_API {
return (length() % align) == 0;
}
bool is_n_page_sized() const { return is_n_align_sized(CEPH_PAGE_SIZE); }
bool is_partial() const { return start() > 0 || end() < raw_length(); }

// accessors
raw *get_raw() const { return _raw; }
Expand Down
8 changes: 6 additions & 2 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -5550,8 +5550,12 @@ int BlueStore::_setattrs(TransContext *txc,
goto out;
}
for (map<string,bufferptr>::const_iterator p = aset.begin();
p != aset.end(); ++p)
o->onode.attrs[p->first] = p->second;
p != aset.end(); ++p) {
if (p->second.is_partial())
o->onode.attrs[p->first] = bufferptr(p->second.c_str(), p->second.length());
else
o->onode.attrs[p->first] = p->second;
}
txc->write_onode(o);
r = 0;

Expand Down