summaryrefslogtreecommitdiffstats
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-11-01 18:17:23 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-11-01 18:17:23 -0400
commit78a63f1235deb1ab9c0780b332d9cc18270247e2 (patch)
treeded7d7129a430b36b9a56528b395478aef37d14c /fs/nfs/read.c
parent3bf0fb6f33dd545693da5e65f5b1b9b9f0bfc35e (diff)
parent331bc71cb1751d78f6807ad8e6162b07c67cdd1b (diff)
downloadlinux-78a63f1235deb1ab9c0780b332d9cc18270247e2.tar.bz2
Merge tag 'nfs-for-4.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
backmerge to do fixup of iov_iter_kvec() conflict
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r--fs/nfs/read.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 48d7277c60a9..f9f19784db82 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -276,16 +276,14 @@ static void nfs_readpage_result(struct rpc_task *task,
struct nfs_pgio_header *hdr)
{
if (hdr->res.eof) {
- loff_t bound;
+ loff_t pos = hdr->args.offset + hdr->res.count;
+ unsigned int new = pos - hdr->io_start;
- bound = hdr->args.offset + hdr->res.count;
- spin_lock(&hdr->lock);
- if (bound < hdr->io_start + hdr->good_bytes) {
+ if (hdr->good_bytes > new) {
+ hdr->good_bytes = new;
set_bit(NFS_IOHDR_EOF, &hdr->flags);
clear_bit(NFS_IOHDR_ERROR, &hdr->flags);
- hdr->good_bytes = bound - hdr->io_start;
}
- spin_unlock(&hdr->lock);
} else if (hdr->res.count < hdr->args.count)
nfs_readpage_retry(task, hdr);
}