From: Sachin Prabhu Date: Thu, 31 May 2012 16:45:00 +0000 (+0100) Subject: NFSv2: EOF incorrectly set on short read X-Git-Tag: v3.5-rc3~6^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=64f9a83665e4f168ff50ce1db9eb175f954048fa;p=karo-tx-linux.git 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 Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index a706b6bcc286..617c7419a08e 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -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 * 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; } return 0;