]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/zns: ensure writes happen at write pointer.
authorAravind Ramesh <Aravind.Ramesh@wdc.com>
Wed, 29 Jun 2022 10:57:40 +0000 (16:27 +0530)
committerAravind <aravind.ramesh@wdc.com>
Wed, 31 Aug 2022 17:35:12 +0000 (23:05 +0530)
For ZNS SSDs, every write to a segment/zone has to happen at the zone's
write pointer. Any write request to an offset which is not at
write pointer will be failed by the drive.
In ZNSSegment::write() error out if write offset is not same as WP.

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

index 4127d0f729e5d9424107e179b0c801bf218ff790..95c35b727317737610eacb9d451b75d0a9a1de2e 100644 (file)
@@ -590,8 +590,8 @@ Segment::write_ertr::future<> ZNSSegment::write(
   seastore_off_t offset, ceph::bufferlist bl)
 {
   LOG_PREFIX(ZNSSegment::write);
-  if (offset < write_pointer || offset % manager.metadata.block_size != 0) {
-    ERROR("invalid segment write on segment {} to offset {}",
+  if (offset != write_pointer || offset % manager.metadata.block_size != 0) {
+    ERROR("Invalid segment write on segment {} to offset {}",
       id,
       offset);
     return crimson::ct_error::invarg::make();