]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/zns: advance write pointer before writing tail-info.
authorAravind Ramesh <Aravind.Ramesh@wdc.com>
Tue, 26 Jul 2022 09:52:17 +0000 (15:22 +0530)
committerAravind <aravind.ramesh@wdc.com>
Fri, 2 Sep 2022 05:06:56 +0000 (10:36 +0530)
commit773d863019e83d0bf03916b408b63db7cde71a2b
tree3b1c70bf9903537ad2de586fb9e1fb50532cdfed
parent79a239ae0a93bd30de525e2614a8ad60404f873e
crimson/zns: advance write pointer before writing tail-info.

SegmentAllocator::close_segment() writes tail information to a
segment before closing the segment, and this is written at the
end of segment. However, for ZNS SSDs, the writes have to always happen
at write pointer, so writing tail info at the end of a zone fails if
the WP is not at the offset requested by close_segment().

If the write pointer is not at lba where the tail information is written,
then advance write pointer by writing zeroes to the zone from it's current
write pointer. Then write the tail information at the end of zone.

Added advance_wp() function which advances the write pointer and then write
tail information, in case of ZNS devices but for a regular device it
continues to write at the end of segment.

Do close_segment() call after writing tail information, closing a segment
first and then writing tail information can cause potential race conditions
on a zns backed segment.

Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
src/crimson/os/seastore/journal/segment_allocator.cc
src/crimson/os/seastore/segment_manager.h
src/crimson/os/seastore/segment_manager/block.cc
src/crimson/os/seastore/segment_manager/block.h
src/crimson/os/seastore/segment_manager/ephemeral.cc
src/crimson/os/seastore/segment_manager/ephemeral.h
src/crimson/os/seastore/segment_manager/zns.cc
src/crimson/os/seastore/segment_manager/zns.h