Skip to content

Commit 64f9a83

Browse files
spuiukTrond Myklebust
authored andcommitted
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: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent c5afc8d commit 64f9a83

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/nfs/proc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
651651
/* Emulate the eof flag, which isn't normally needed in NFSv2
652652
* as it is guaranteed to always return the file attributes
653653
*/
654-
if (data->args.offset + data->args.count >= data->res.fattr->size)
654+
if (data->args.offset + data->res.count >= data->res.fattr->size)
655655
data->res.eof = 1;
656656
}
657657
return 0;

0 commit comments

Comments
 (0)