NFS: Don't use page_file_mapping after removing the page
authorBenjamin Coddington <bcodding@redhat.com>
Wed, 6 Feb 2019 11:09:43 +0000 (06:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:45 +0000 (20:09 +0100)
commit6c023d86b3645fc2671bf2a7677fd208744edbb1
treec0ce30b88814adede5e97713106b10f19ea337de
parentd84bc704b91ed915677d5506ba32514f2b62f09c
NFS: Don't use page_file_mapping after removing the page

[ Upstream commit d2ceb7e57086750ea6198a31fd942d98099a0786 ]

If nfs_page_async_flush() removes the page from the mapping, then we can't
use page_file_mapping() on it as nfs_updatepate() is wont to do when
receiving an error.  Instead, push the mapping to the stack before the page
is possibly truncated.

Fixes: 8fc75bed96bb ("NFS: Fix up return value on fatal errors in nfs_page_async_flush()")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/write.c