diff mbox series

iomap: Fix iomap_readahead_iter error handling

Message ID 20211111140802.577144-1-agruenba@redhat.com (mailing list archive)
State New, archived
Headers show
Series iomap: Fix iomap_readahead_iter error handling | expand

Commit Message

Andreas Gruenbacher Nov. 11, 2021, 2:08 p.m. UTC
In iomap_readahead_iter, deal with potential iomap_readpage_iter errors.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/iomap/buffered-io.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig Nov. 12, 2021, 5:44 a.m. UTC | #1
On Thu, Nov 11, 2021 at 03:08:02PM +0100, Andreas Gruenbacher wrote:
> In iomap_readahead_iter, deal with potential iomap_readpage_iter errors.
> 
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
>  fs/iomap/buffered-io.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 1753c26c8e76..9f1e329e8b2c 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -370,6 +370,8 @@ static loff_t iomap_readahead_iter(const struct iomap_iter *iter,
>  			ctx->cur_page_in_bio = false;
>  		}
>  		ret = iomap_readpage_iter(iter, ctx, done);
> +		if (ret < 0)
> +			return ret;

This already is part of your previous patch.
diff mbox series

Patch

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 1753c26c8e76..9f1e329e8b2c 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -370,6 +370,8 @@  static loff_t iomap_readahead_iter(const struct iomap_iter *iter,
 			ctx->cur_page_in_bio = false;
 		}
 		ret = iomap_readpage_iter(iter, ctx, done);
+		if (ret < 0)
+			return ret;
 	}
 
 	return done;