linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] scsi tgt: kill length alignment test in bin_map_user
@ 2006-02-16 19:53 Mike Christie
  2006-02-16 20:00 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Christie @ 2006-02-16 19:53 UTC (permalink / raw)
  To: Jens Axboe, linux-scsi

Subject: [PATCH] block layer: kill length alignment test in bin_map_user

The tgt project 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: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

---

 fs/bio.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

8e515bd33c31c8dc5e9727792d2c3cbe08bc28e1
diff --git a/fs/bio.c b/fs/bio.c
index 1f3bb50..d8259d9 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -620,10 +620,9 @@ static struct bio *__bio_map_user_iov(re
 
 		nr_pages += end - start;
 		/*
-		 * transfer and buffer must be aligned to at least hardsector
-		 * size for now, in the future we can relax this restriction
+		 * buffer must be aligned to at least hardsector size for now
 		 */
-		if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q)))
+		if (uaddr & queue_dma_alignment(q))
 			return ERR_PTR(-EINVAL);
 	}
 
-- 
1.1.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/6] scsi tgt: kill length alignment test in bin_map_user
  2006-02-16 19:53 [PATCH 2/6] scsi tgt: kill length alignment test in bin_map_user Mike Christie
@ 2006-02-16 20:00 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2006-02-16 20:00 UTC (permalink / raw)
  To: Mike Christie; +Cc: linux-scsi

On Thu, Feb 16 2006, Mike Christie wrote:
> Subject: [PATCH] block layer: kill length alignment test in bin_map_user
> 
> The tgt project 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.

As previously discussed, this is fine with me. It's a mixed check
anyways, if we need length check in the future it should be a seperate
attribute.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-16 20:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-16 19:53 [PATCH 2/6] scsi tgt: kill length alignment test in bin_map_user Mike Christie
2006-02-16 20:00 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).