diff options
author | 2025-07-01 15:21:48 +0300 | |
---|---|---|
committer | 2025-07-14 15:20:28 -0700 | |
commit | 81438498a285759f31e843ac4800f82a5ce6521f (patch) | |
tree | 00f00faf07363db5649816d9c4ad9a1046d14dfd /tools/perf/scripts/python | |
parent | pNFS: Handle RPC size limit for layoutcommits (diff) | |
download | wireguard-linux-81438498a285759f31e843ac4800f82a5ce6521f.tar.xz wireguard-linux-81438498a285759f31e843ac4800f82a5ce6521f.zip |
pNFS: Fix stripe mapping in block/scsi layout
Because of integer division, we need to carefully calculate the
disk offset. Consider the example below for a stripe of 6 volumes,
a chunk size of 4096, and an offset of 70000.
chunk = div_u64(offset, dev->chunk_size) = 70000 / 4096 = 17
offset = chunk * dev->chunk_size = 17 * 4096 = 69632
disk_offset_wrong = div_u64(offset, dev->nr_children) = 69632 / 6 = 11605
disk_chunk = div_u64(chunk, dev->nr_children) = 17 / 6 = 2
disk_offset = disk_chunk * dev->chunk_size = 2 * 4096 = 8192
Signed-off-by: Sergey Bashirov <sergeybashirov@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250701122341.199112-1-sergeybashirov@gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions