summaryrefslogtreecommitdiff
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-12 18:04:36 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-19 08:56:04 -0400
commiteb2c50da9e256dbbb3ff27694440e4c1900cfef8 (patch)
treefb5c36bec2b2b8fdceeac4bc0e1fb74455b7e971 /fs/nfs/pagelist.c
parentf4340e9314dbfadc48758945f85fc3b16612d06f (diff)
downloadlwn-eb2c50da9e256dbbb3ff27694440e4c1900cfef8.tar.gz
lwn-eb2c50da9e256dbbb3ff27694440e4c1900cfef8.zip
NFS: Ensure O_DIRECT reports an error if the bytes read/written is 0
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+
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r--fs/nfs/pagelist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 15c254753f88..56cefa0ab804 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -1266,6 +1266,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;