summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorAndrea Parri <parri.andrea@gmail.com>2026-09-28 10:48:08 +0200
committerChristian Brauner <brauner@kernel.org>2026-10-13 16:58:07 +0200
commit0d0104adc2c8316433b660cdf6d182a09881864f (patch)
treeed767e2edd90bec59c9365235218b29577f7ffa1 /tools/lib/python
parent1c3fe56094dd23b3446b93247172980037229dc9 (diff)
downloadlinux-next-0d0104adc2c8316433b660cdf6d182a09881864f.tar.gz
linux-next-0d0104adc2c8316433b660cdf6d182a09881864f.zip
iomap: don't lose a fiemap iteration error when emitting the last extent
iomap_fiemap() emits extents one behind: iomap_fiemap_iter() flushes the previous extent and remembers the current one, and the remembered extent is written with FIEMAP_EXTENT_LAST after the iteration loop. That final flush overwrites ret, so when ->iomap_begin() fails partway through the iteration the error is replaced by the result of iomap_to_fiemap() (zero on success) and iomap_fiemap() returns success with a truncated extent list whose last entry is wrongly marked as the last extent in the file. The pre-iomap_iter code returned the error from inside the loop, before flushing the pending extent. Check for the iteration error before flushing the pending extent, so that real errors are propagated and only a successful iteration emits the final FIEMAP_EXTENT_LAST extent. -ENOENT (no mapping) is still not an error, and the pending extent is still emitted in that case. Fixes: 7892386d3571 ("iomap: switch iomap_fiemap to use iomap_iter") Cc: stable@vger.kernel.org # v5.15 Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrea Parri <parri.andrea@gmail.com> Link: https://patch.msgid.link/250226e33b3b23c6b1714a45dc3c465c2a45cdc0.1790342457.git.parri.andrea@gmail.com Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions