Merge git://git.infradead.org/mtd-2.6
[sfrench/cifs-2.6.git] / fs / bio.c
index 098c12b2d60a9d8028a6a8fbdb2b03ecca84e3ba..6a0b9ad8f8c9d031d4c32fb32e1c53e0677d1ef2 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -654,9 +654,10 @@ static struct bio *__bio_map_user_iov(request_queue_t *q,
                                     write_to_vm, 0, &pages[cur_page], NULL);
                up_read(&current->mm->mmap_sem);
 
-               if (ret < local_nr_pages)
+               if (ret < local_nr_pages) {
+                       ret = -EFAULT;
                        goto out_unmap;
-
+               }
 
                offset = uaddr & ~PAGE_MASK;
                for (j = cur_page; j < page_limit; j++) {