* [PATCH] block: fix blk_queue_alignment_offset
@ 2009-07-19 22:36 Christoph Hellwig
2009-07-20 2:19 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2009-07-19 22:36 UTC (permalink / raw)
To: Martin K. Petersen; +Cc: linux-kernel
We need to mask out bits inside the logical block, not outside of it,
otherwise we'll always get a 0 alignment_offset.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/block/blk-settings.c
===================================================================
--- linux-2.6.orig/block/blk-settings.c 2009-07-19 23:53:13.674148645 +0200
+++ linux-2.6/block/blk-settings.c 2009-07-20 00:33:06.384900956 +0200
@@ -371,7 +371,7 @@ EXPORT_SYMBOL(blk_queue_physical_block_s
void blk_queue_alignment_offset(struct request_queue *q, unsigned int offset)
{
q->limits.alignment_offset =
- offset & (q->limits.physical_block_size - 1);
+ offset & ~(q->limits.physical_block_size - 1);
q->limits.misaligned = 0;
}
EXPORT_SYMBOL(blk_queue_alignment_offset);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] block: fix blk_queue_alignment_offset
2009-07-19 22:36 [PATCH] block: fix blk_queue_alignment_offset Christoph Hellwig
@ 2009-07-20 2:19 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2009-07-20 2:19 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Martin K. Petersen, linux-kernel
>>>>> "hch" == Christoph Hellwig <hch@lst.de> writes:
hch> We need to mask out bits inside the logical block, not outside of
hch> it, otherwise we'll always get a 0 alignment_offset.
The alignment_offset only makes sense if physical_block_size >
logical_block_size. For instance (63 * 512) & (4096 - 1) = 3584.
Your patch would yield 28672 = 4096 * 7 and that's incorrect; LBA 63 is
not aligned on a 4KB boundary...
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-20 2:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 22:36 [PATCH] block: fix blk_queue_alignment_offset Christoph Hellwig
2009-07-20 2:19 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox