NFS: Further fixes to the writeback error handling
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 14 May 2022 14:08:12 +0000 (10:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:15 +0000 (10:23 +0200)
commit08b9d374c84a81ab88e4be6c30748681608ed707
tree26c7512f6232176bb48aedb5b0999d6720ddea40
parenteaf407d5b5fe6a829f60357038f99c38e2986dcb
NFS: Further fixes to the writeback error handling

[ Upstream commit c6fd3511c3397dd9cbc6dc5d105bbedb69bf4061 ]

When we handle an error by redirtying the page, we're not corrupting the
mapping, so we don't want the error to be recorded in the mapping.
If the caller has specified a sync_mode of WB_SYNC_NONE, we can just
return AOP_WRITEPAGE_ACTIVATE. However if we're dealing with
WB_SYNC_ALL, we need to ensure that retries happen when the errors are
non-fatal.

Reported-by: Olga Kornievskaia <aglo@umich.edu>
Fixes: 8fc75bed96bb ("NFS: Fix up return value on fatal errors in nfs_page_async_flush()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/write.c