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:23:30 +0000 (08:23 +0200)
commitb291baae24f876acd5a5dd57d0bb2bbac8a68b0c
tree7655e406436fae1ce2869f1ffba13f0b16c91b68
parentb287521e9e94bb342ebe5fd8c3fd7db9aef4e6f1
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