mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 09:41:54 +09:00
NFSv2: Fix eof handling
[ Upstream commit 71affe9be4 ]
If we received a reply from the server with a zero length read and
no error, then that implies we are at eof.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
01b7134efc
commit
cb8b1858f2
@@ -589,7 +589,8 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
|
||||
/* Emulate the eof flag, which isn't normally needed in NFSv2
|
||||
* as it is guaranteed to always return the file attributes
|
||||
*/
|
||||
if (hdr->args.offset + hdr->res.count >= hdr->res.fattr->size)
|
||||
if ((hdr->res.count == 0 && hdr->args.count > 0) ||
|
||||
hdr->args.offset + hdr->res.count >= hdr->res.fattr->size)
|
||||
hdr->res.eof = 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user