summaryrefslogtreecommitdiff
path: root/rust/helpers/build_bug.c
diff options
context:
space:
mode:
authorSergey Bashirov <sergeybashirov@gmail.com>2025-06-30 21:35:27 +0300
committerTrond Myklebust <trond.myklebust@hammerspace.com>2025-07-14 15:20:28 -0700
commitd84c4754f8740915da9977a282f72a3b2b0e0ac9 (patch)
tree9be896b1e309d7fa8322c09e7918a19861dc0d45 /rust/helpers/build_bug.c
parent9768797c219326699778fba9cd3b607b2f1e7950 (diff)
pNFS: Fix extent encoding in block/scsi layout
The ext_tree_encode_commit() function may be called multiple times for the same file, layout, and last written byte if the provided buffer is not large enough to encode all extents in it. The first problem is that the last written byte field must be zeroed only on a successful call, otherwise we will lose its actual value and get an integer overflow on the next encoding attempt. The second problem is that we can't count and encode in one pass. The extent state changes during encoding, so if we return -ENOSPC but have already encoded some extents into a small buffer, they will not be re-encoded into a new larger buffer on the next try. As a result, the client never commits these extents to the server. Co-developed-by: Konstantin Evtushenko <koevtushenko@yandex.com> Signed-off-by: Konstantin Evtushenko <koevtushenko@yandex.com> Signed-off-by: Sergey Bashirov <sergeybashirov@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250630183537.196479-3-sergeybashirov@gmail.com Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'rust/helpers/build_bug.c')
0 files changed, 0 insertions, 0 deletions