Skip to content

Commit de291b5

Browse files
Christoph Hellwigdjbw
authored andcommitted
iomap: turn the byte variable in iomap_zero_iter into a ssize_t
@bytes also holds the return value from iomap_write_end, which can contain a negative error value. As @bytes is always less than the page size even the signed type can hold the entire possible range. Fixes: c6f4046 ("fsdax: decouple zeroing from the iomap buffered I/O code") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent b80892c commit de291b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/iomap/buffered-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static loff_t iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
883883

884884
do {
885885
unsigned offset = offset_in_page(pos);
886-
size_t bytes = min_t(u64, PAGE_SIZE - offset, length);
886+
ssize_t bytes = min_t(u64, PAGE_SIZE - offset, length);
887887
struct page *page;
888888
int status;
889889

0 commit comments

Comments
 (0)