Commit ad2d7225 authored by Mike Christie's avatar Mike Christie Committed by Jens Axboe

[PATCH] block: kill length alignment test in bio_map_user()

The target mode support is mapping in bios using bio_map_user. The
current targets do not need their len to be aligned with a queue limit
so this check is causing some problems. Note: pointers passed into the
kernel are properly aligned by usersapace tgt code so the uaddr check
in bio_map_user is ok.

The major user, blk_bio_map_user checks for the len before mapping
so it is not affected by this patch.

And the semi-newly added user blk_rq_map_user_iov has been failing
out when the len is not aligned properly so maybe people have been
good and not sending misaligned lens or that path is not used very
often and this change will not be very dangerous. st and sg do not
check the length and we have not seen any problem reports from those
wider used paths so this patch should be fairly safe - for mm
and wider testing at least.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent be1c6341
...@@ -622,10 +622,9 @@ static struct bio *__bio_map_user_iov(request_queue_t *q, ...@@ -622,10 +622,9 @@ static struct bio *__bio_map_user_iov(request_queue_t *q,
nr_pages += end - start; nr_pages += end - start;
/* /*
* transfer and buffer must be aligned to at least hardsector * buffer must be aligned to at least hardsector size for now
* size for now, in the future we can relax this restriction
*/ */
if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q))) if (uaddr & queue_dma_alignment(q))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment