[PATCH] block: fix blk_queue_alignment_offset

From: Christoph Hellwig
Date: Sun Jul 19 2009 - 18:37:11 EST


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@xxxxxx>

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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/