From 18e419f6e80a6d3c8aaab94abd55c3b41741d8df Mon Sep 17 00:00:00 2001 From: Stefan Roesch Date: Thu, 23 Jun 2022 10:51:49 -0700 Subject: [PATCH] iomap: Return -EAGAIN from iomap_write_iter() If iomap_write_iter() encounters -EAGAIN, return -EAGAIN to the caller. Signed-off-by: Stefan Roesch Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220623175157.1715274-7-shr@fb.com Reviewed-by: Christoph Hellwig [axboe: make the suggested ternary edit] Signed-off-by: Jens Axboe --- fs/iomap/buffered-io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 83cf093fcb92..c681eacc389b 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -830,6 +830,10 @@ static loff_t iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i) length -= status; } while (iov_iter_count(i) && length); + if (status == -EAGAIN) { + iov_iter_revert(i, written); + return -EAGAIN; + } return written ? written : status; }