NFS: Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 25 May 2021 14:40:12 +0000 (10:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:36:18 +0000 (08:36 +0200)
commitc757c1f1e65d89429db1409429436cf40d47c008
tree9cf80f988849fff6d1cf35c6ac5e3696b963fb70
parentf299522eda1566cbfbae4b15c82970fc41b03714
NFS: Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce()

commit 0d0ea309357dea0d85a82815f02157eb7fcda39f upstream.

The value of mirror->pg_bytes_written should only be updated after a
successful attempt to flush out the requests on the list.

Fixes: a7d42ddb3099 ("nfs: add mirroring support to pgio layer")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pagelist.c