mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
iomap: Fix error handling in iomap_zero_iter()
iomap_write_end() does not return a negative errno to indicate an
error, but the number of bytes successfully copied. It cannot return
an error today, so include a debugging assertion like the one in
iomap_unshare_iter().
Fixes: c6f4046865
("fsdax: decouple zeroing from the iomap buffered I/O code")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211221044450.517558-1-willy@infradead.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
abc14eb1e0
commit
9e05e95ca8
1 changed files with 2 additions and 2 deletions
|
@ -895,8 +895,8 @@ static loff_t iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
|
||||||
mark_page_accessed(page);
|
mark_page_accessed(page);
|
||||||
|
|
||||||
bytes = iomap_write_end(iter, pos, bytes, bytes, page);
|
bytes = iomap_write_end(iter, pos, bytes, bytes, page);
|
||||||
if (bytes < 0)
|
if (WARN_ON_ONCE(bytes == 0))
|
||||||
return bytes;
|
return -EIO;
|
||||||
|
|
||||||
pos += bytes;
|
pos += bytes;
|
||||||
length -= bytes;
|
length -= bytes;
|
||||||
|
|
Loading…
Reference in a new issue