]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Fix a potential data corruption
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 19 Aug 2023 21:22:14 +0000 (17:22 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:56 +0000 (12:22 +0200)
commitda302f1d476a44245823a74546debb5d160bf5bd
tree87da0975588dfa4c3340564e946bc3d1afc26ec5
parent0db19df21be51d4f7bee5406112c2b3418b826d8
NFS: Fix a potential data corruption

commit 88975a55969e11f26fe3846bf4fbf8e7dc8cbbd4 upstream.

We must ensure that the subrequests are joined back into the head before
we can retransmit a request. If the head was not on the commit lists,
because the server wrote it synchronously, we still need to add it back
to the retransmission list.
Add a call that mirrors the effect of nfs_cancel_remove_inode() for
O_DIRECT.

Fixes: ed5d588fe47f ("NFS: Try to join page groups before an O_DIRECT retransmission")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/direct.c