diff options
-rw-r--r-- | kernel/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/file.c b/kernel/file.c index 9cadfcb..2486e7a 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -589,7 +589,8 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf, nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; - npages = min(max(npages, 1), FUSE_MAX_PAGES_PER_REQ); + npages = max(npages, 1); + npages = min(npages, FUSE_MAX_PAGES_PER_REQ); down_read(¤t->mm->mmap_sem); npages = get_user_pages(current, current->mm, user_addr, npages, write, 0, req->pages, NULL); |