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:22:23 +0000 (10:22 +0200)
commit4f4be79c9ee7f36996163c6cf7056dae94e1b17e
tree14254a0d5cdff9ba1694032ea362bc736613edbb
parentb5891b624b9a5d3dd65b6c5a6601480bcb1a3dc3
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