NFS: Ensure O_DIRECT reports an error if the bytes read/written is 0
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 12 Aug 2019 22:04:36 +0000 (18:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:21:01 +0000 (10:21 +0200)
commit1a17912f93b896138f9d8b44aa11a4477a772823
treefca976ab7238efb508d48e1a33dff9f14c5205ee
parente4ca24bdcea96cf5143afe197b649060b40d5fd8
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>
fs/nfs/direct.c
fs/nfs/pagelist.c