Skip to content

Commit 688df4b

Browse files
authored
Merge pull request ceph#62121 from aclamk/wip-aclamk-bluefs-truncate-alloc-size
os/bluestore: In BlueFS::truncate accept wierd alloc_unit
2 parents 6343ee7 + 0da7a2a commit 688df4b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/os/bluestore/BlueFS.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4224,10 +4224,12 @@ int BlueFS::truncate(FileWriter *h, uint64_t offset)/*_WF_L*/
42244224
changed_extents = true;
42254225
++p;
42264226
} else {
4227-
// cut_off > p->length means that we misaligned the extent
4228-
ceph_assert(cut_off == p->length);
4227+
// Usually cut_off == p->length.
4228+
// Case cut_off > p->length means that we misaligned the extent
4229+
// or alloc size changed in the meantime.
4230+
// In both cases just leave extent untouched.
42294231
fnode.allocated = (offset - x_off) + p->length;
4230-
++p; // leave extent untouched
4232+
++p;
42314233
}
42324234
while (p != fnode.extents.end()) {
42334235
dirty.pending_release[p->bdev].insert(p->offset, p->length);

0 commit comments

Comments
 (0)