Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21029
b: refs/heads/master
c: 143f412
h: refs/heads/master
i:
  21027: 89d3366
v: v3
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed Mar 14, 2006
1 parent b121fa8 commit c0ba2f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9a3879abf2f1a27c39915e6074b8ff15a24cb55
refs/heads/master: 143f412eb4c7cc48b9eb4381f9133b7d36c68075
10 changes: 10 additions & 0 deletions trunk/fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#define NFSDBG_FACILITY NFSDBG_VFS
#define MAX_DIRECTIO_SIZE (4096UL << PAGE_SHIFT)

static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty);
static kmem_cache_t *nfs_direct_cachep;

/*
Expand Down Expand Up @@ -107,6 +108,15 @@ nfs_get_user_pages(int rw, unsigned long user_addr, size_t size,
page_count, (rw == READ), 0,
*pages, NULL);
up_read(&current->mm->mmap_sem);
/*
* If we got fewer pages than expected from get_user_pages(),
* the user buffer runs off the end of a mapping; return EFAULT.
*/
if (result >= 0 && result < page_count) {
nfs_free_user_pages(*pages, result, 0);
*pages = NULL;
result = -EFAULT;
}
}
return result;
}
Expand Down

0 comments on commit c0ba2f1

Please sign in to comment.