diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-08-13 01:04:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-06 11:21:01 +0300 |
commit | 1a17912f93b896138f9d8b44aa11a4477a772823 (patch) | |
tree | fca976ab7238efb508d48e1a33dff9f14c5205ee /fs/nfs/pagelist.c | |
parent | e4ca24bdcea96cf5143afe197b649060b40d5fd8 (diff) | |
download | linux-1a17912f93b896138f9d8b44aa11a4477a772823.tar.xz |
NFS: Ensure O_DIRECT reports an error if the bytes read/written is 0
[ Upstream commit eb2c50da9e256dbbb3ff27694440e4c1900cfef8 ]
If the attempt to resend the I/O results in no bytes being read/written,
we must ensure that we report the error.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Fixes: 0a00b77b331a ("nfs: mirroring support for direct io")
Cc: stable@vger.kernel.org # v3.20+
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 16d7f9068c7a..132e568524df 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -1247,6 +1247,7 @@ int nfs_pageio_resend(struct nfs_pageio_descriptor *desc, if (!list_empty(&pages)) { int err = desc->pg_error < 0 ? desc->pg_error : -EIO; hdr->completion_ops->error_cleanup(&pages, err); + nfs_set_pgio_error(hdr, err, hdr->io_start); return err; } return 0; |