Skip to content

Commit

Permalink
NFS: Don't report errors from nfs_pageio_complete() more than once
Browse files Browse the repository at this point in the history
[ Upstream commit c5e483b ]

Since errors from nfs_pageio_complete() are already being reported
through nfs_async_write_error(), we should not be returning them to the
callers of do_writepages() as well. They will end up being reported
through the generic mechanism instead.

Fixes: 6fbda89 ("NFS: Replace custom error reporting mechanism with generic one")
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>
  • Loading branch information
Trond Myklebust authored and gregkh committed Jun 9, 2022
1 parent a3bbd8b commit 471577e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fs/nfs/write.c
Expand Up @@ -675,11 +675,7 @@ static int nfs_writepage_locked(struct page *page,
err = nfs_do_writepage(page, wbc, &pgio);
pgio.pg_error = 0;
nfs_pageio_complete(&pgio);
if (err < 0)
return err;
if (nfs_error_is_fatal(pgio.pg_error))
return pgio.pg_error;
return 0;
return err;
}

int nfs_writepage(struct page *page, struct writeback_control *wbc)
Expand Down Expand Up @@ -737,9 +733,6 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)

if (err < 0)
goto out_err;
err = pgio.pg_error;
if (nfs_error_is_fatal(err))
goto out_err;
return 0;
out_err:
return err;
Expand Down

0 comments on commit 471577e

Please sign in to comment.