]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fuse/file.c
fuse: fix max i/o size calculation
[linux-2.6-omap-h63xx.git] / fs / fuse / file.c
index a02418c89d4bbc52a9670d6a91cc2b1e68503a63..2d3649e42599d41eb4a6b7c7e0afaa4cac96e58a 100644 (file)
@@ -966,14 +966,15 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf,
 
        while (count) {
                size_t nres;
-               size_t nbytes = min(count, nmax);
-               int err = fuse_get_user_pages(req, buf, nbytes, !write);
+               size_t nbytes_limit = min(count, nmax);
+               size_t nbytes;
+               int err = fuse_get_user_pages(req, buf, nbytes_limit, !write);
                if (err) {
                        res = err;
                        break;
                }
                nbytes = (req->num_pages << PAGE_SHIFT) - req->page_offset;
-               nbytes = min(count, nbytes);
+               nbytes = min(nbytes_limit, nbytes);
                if (write)
                        nres = fuse_send_write(req, file, inode, pos, nbytes,
                                               current->files);