diff options
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r-- | fs/nfs/proc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 5552fa8b6e12..0f7288b94633 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -594,7 +594,8 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr) | |||
594 | /* Emulate the eof flag, which isn't normally needed in NFSv2 | 594 | /* Emulate the eof flag, which isn't normally needed in NFSv2 |
595 | * as it is guaranteed to always return the file attributes | 595 | * as it is guaranteed to always return the file attributes |
596 | */ | 596 | */ |
597 | if (hdr->args.offset + hdr->res.count >= hdr->res.fattr->size) | 597 | if ((hdr->res.count == 0 && hdr->args.count > 0) || |
598 | hdr->args.offset + hdr->res.count >= hdr->res.fattr->size) | ||
598 | hdr->res.eof = 1; | 599 | hdr->res.eof = 1; |
599 | } | 600 | } |
600 | return 0; | 601 | return 0; |
@@ -615,8 +616,10 @@ static int nfs_proc_pgio_rpc_prepare(struct rpc_task *task, | |||
615 | 616 | ||
616 | static int nfs_write_done(struct rpc_task *task, struct nfs_pgio_header *hdr) | 617 | static int nfs_write_done(struct rpc_task *task, struct nfs_pgio_header *hdr) |
617 | { | 618 | { |
618 | if (task->tk_status >= 0) | 619 | if (task->tk_status >= 0) { |
620 | hdr->res.count = hdr->args.count; | ||
619 | nfs_writeback_update_inode(hdr); | 621 | nfs_writeback_update_inode(hdr); |
622 | } | ||
620 | return 0; | 623 | return 0; |
621 | } | 624 | } |
622 | 625 | ||