[PATCH] 32-bit compatibility HDIO IOCTLs
[powerpc.git] / fs / bio.c
index 098c12b..8f93e93 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Jens Axboe <axboe@suse.de>
+ * Copyright (C) 2001 Jens Axboe <axboe@kernel.dk>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -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++) {
@@ -1141,7 +1142,7 @@ static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale)
                struct biovec_slab *bp = bvec_slabs + i;
                mempool_t **bvp = bs->bvec_pools + i;
 
-               if (i >= scale)
+               if (pool_entries > 1 && i >= scale)
                        pool_entries >>= 1;
 
                *bvp = mempool_create_slab_pool(pool_entries, bp->slab);