From: Trond Myklebust Date: Fri, 15 Feb 2019 21:08:25 +0000 (-0500) Subject: NFS: Don't recoalesce on error in nfs_pageio_complete_mirror() X-Git-Tag: v4.14.108~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9aaa2ef05a43367fdf9ec35cf7f586631c824ac8;p=thirdparty%2Fkernel%2Fstable.git NFS: Don't recoalesce on error in nfs_pageio_complete_mirror() commit 8127d82705998568b52ac724e28e00941538083d upstream. If the I/O completion failed with a fatal error, then we should just exit nfs_pageio_complete_mirror() rather than try to recoalesce. Fixes: a7d42ddb3099 ("nfs: add mirroring support to pgio layer") Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # v4.0+ Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index dfed48dc216fc..28b013d1d44ae 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -1213,7 +1213,7 @@ static void nfs_pageio_complete_mirror(struct nfs_pageio_descriptor *desc, desc->pg_mirror_idx = mirror_idx; for (;;) { nfs_pageio_doio(desc); - if (!mirror->pg_recoalesce) + if (desc->pg_error < 0 || !mirror->pg_recoalesce) break; if (!nfs_do_recoalesce(desc)) break;