Skip to content

Commit

Permalink
Merge pull request #10686 from liewegas/wip-bluefs-remove
Browse files Browse the repository at this point in the history
os/bluestore/BlueFS: do not op_file_update deleted files

Tested-by: Somnath Roy <somnath.roy@sandisk.com>
  • Loading branch information
liewegas committed Aug 17, 2016
2 parents 810f660 + 6f77e63 commit 2611cdc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/os/bluestore/BlueFS.cc
Expand Up @@ -1298,7 +1298,10 @@ int BlueFS::_truncate(FileWriter *h, uint64_t offset)
{
dout(10) << __func__ << " 0x" << std::hex << offset << std::dec
<< " file " << h->file->fnode << dendl;

if (h->file->deleted) {
dout(10) << __func__ << " deleted, no-op" << dendl;
return 0;
}
// truncate off unflushed data?
if (h->pos < offset &&
h->pos + h->buffer.length() > offset) {
Expand Down Expand Up @@ -1417,6 +1420,10 @@ int BlueFS::_preallocate(FileRef f, uint64_t off, uint64_t len)
{
dout(10) << __func__ << " file " << f->fnode << " 0x"
<< std::hex << off << "~" << len << std::dec << dendl;
if (f->deleted) {
dout(10) << __func__ << " deleted, no-op" << dendl;
return 0;
}
uint64_t allocated = f->fnode.get_allocated();
if (off + len > allocated) {
uint64_t want = off + len - allocated;
Expand Down

0 comments on commit 2611cdc

Please sign in to comment.