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:38:08 +0000 (08:38 +0200)
commit40f139a6d50c232c0d1fd1c5e65a845c62db0ede
tree7801bfb900672cf082ad34d445da4c0eed133f49
parent945ebef997227ca8c20bad7f8a8358c8ee57a84a
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