Skip to content

Commit

Permalink
Merge pull request #21408 from hsepeng/oisizemismatch-osd-bugfix
Browse files Browse the repository at this point in the history
osd/PrimaryLogPG: fix the oi size mismatch with real object size

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Apr 23, 2018
2 parents 4f73c60 + 4a34f11 commit 9f35318
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/osd/PrimaryLogPG.cc
Expand Up @@ -8039,7 +8039,8 @@ void PrimaryLogPG::write_update_size_and_usage(object_stat_sum_t& delta_stats, o
} else if (length)
ch.insert(offset, length);
modified.union_of(ch);
if (write_full || offset + length > oi.size) {
if (write_full ||
(offset + length > oi.size && length)) {
uint64_t new_size = offset + length;
delta_stats.num_bytes -= oi.size;
delta_stats.num_bytes += new_size;
Expand Down

0 comments on commit 9f35318

Please sign in to comment.