Commit c5ed7ce
committed
crimson/seastore: use DMA alignment for block size instead of stat
Before this fix, BlockSegmentManager used stat.block_size (typically 512
bytes from file_stat()) as the alignment requirement for writes. However,
Seastar's DMA engine requires alignment to disk_write_dma_alignment()
(typically 4096 bytes, the logical block size) for performant writes.
This mismatch caused failures in BlockSegmentManager::segment_write():
1. Crimson believed block_size was 512 bytes (from file_stat())
2. Crimson prepared 512-byte aligned buffers for writing
3. Seastar's internal::sanitize_iovecs() trimmed the unaligned portions
based on the actual 4096-byte DMA alignment requirement
4. This left an empty buffer (512 bytes trimmed from 512-byte buffer)
5. The write operation returned 0 bytes written
6. The assertion 'written != len' failed in do_writev()
The fix queries the actual DMA alignment requirement from Seastar via
file.disk_write_dma_alignment() and uses that as block_size throughout
the segment manager. This ensures all writes are properly aligned for
Seastar's DMA engine.
Signed-off-by: Kefu Chai <[email protected]>1 parent e59cb2c commit c5ed7ce
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| |||
0 commit comments