Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64f9a836 authored by Sachin Prabhu's avatar Sachin Prabhu Committed by Trond Myklebust
Browse files

NFSv2: EOF incorrectly set on short read



In cases where the server returns fewer bytes then those requested, we
can incorrectly set the eof flag for the file. Fixing this allows the
request to be retried with updated offset and count arguments.

Signed-off-by: default avatarSachin Prabhu <sprabhu@redhat.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent c5afc8da
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -651,7 +651,7 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
		/* Emulate the eof flag, which isn't normally needed in NFSv2
		/* Emulate the eof flag, which isn't normally needed in NFSv2
		 * as it is guaranteed to always return the file attributes
		 * as it is guaranteed to always return the file attributes
		 */
		 */
		if (data->args.offset + data->args.count >= data->res.fattr->size)
		if (data->args.offset + data->res.count >= data->res.fattr->size)
			data->res.eof = 1;
			data->res.eof = 1;
	}
	}
	return 0;
	return 0;