* [PATCH] dm log: fix create_log_context() to use proper logical_block_size
@ 2009-06-17 16:21 Mike Snitzer
2009-06-17 16:26 ` Martin K. Petersen
0 siblings, 1 reply; 3+ messages in thread
From: Mike Snitzer @ 2009-06-17 16:21 UTC (permalink / raw)
To: dm-devel
create_log_context() must use the logical_block_size from the log disk
rather than the target's logical_block_size.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
drivers/md/dm-log.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux-2.6/drivers/md/dm-log.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-log.c
+++ linux-2.6/drivers/md/dm-log.c
@@ -404,17 +404,19 @@ static int create_log_context(struct dm_
}
lc->disk_header = NULL;
} else {
+ struct request_queue *q;
lc->log_dev = dev;
lc->log_dev_failed = 0;
lc->header_location.bdev = lc->log_dev->bdev;
lc->header_location.sector = 0;
+ q = bdev_get_queue(lc->header_location.bdev);
/*
* Buffer holds both header and bitset.
*/
buf_size = dm_round_up((LOG_OFFSET << SECTOR_SHIFT) +
bitset_size,
- ti->limits.logical_block_size);
+ q->limits.logical_block_size);
if (buf_size > i_size_read(dev->bdev->bd_inode)) {
DMWARN("log device %s too small: need %llu bytes",
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dm log: fix create_log_context() to use proper logical_block_size
2009-06-17 16:21 [PATCH] dm log: fix create_log_context() to use proper logical_block_size Mike Snitzer
@ 2009-06-17 16:26 ` Martin K. Petersen
2009-06-17 16:29 ` Mike Snitzer
0 siblings, 1 reply; 3+ messages in thread
From: Martin K. Petersen @ 2009-06-17 16:26 UTC (permalink / raw)
To: device-mapper development
>>>>> "Mike" == Mike Snitzer <snitzer@redhat.com> writes:
Mike> create_log_context() must use the logical_block_size from the log
Mike> disk rather than the target's logical_block_size.
Mike> buf_size = dm_round_up((LOG_OFFSET << SECTOR_SHIFT) +
Mike> bitset_size,
Mike> - ti->limits.logical_block_size);
Mike> + q->limits.logical_block_size);
Please use the accessor functions when possible.
bdev_logical_block_size(lc->header_location.bdev) to the rescue....
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: dm log: fix create_log_context() to use proper logical_block_size
2009-06-17 16:26 ` Martin K. Petersen
@ 2009-06-17 16:29 ` Mike Snitzer
0 siblings, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2009-06-17 16:29 UTC (permalink / raw)
To: Martin K. Petersen; +Cc: device-mapper development
On Wed, Jun 17 2009 at 12:26pm -0400,
Martin K. Petersen <martin.petersen@oracle.com> wrote:
> >>>>> "Mike" == Mike Snitzer <snitzer@redhat.com> writes:
>
> Mike> create_log_context() must use the logical_block_size from the log
> Mike> disk rather than the target's logical_block_size.
>
> Mike> buf_size = dm_round_up((LOG_OFFSET << SECTOR_SHIFT) +
> Mike> bitset_size,
> Mike> - ti->limits.logical_block_size);
> Mike> + q->limits.logical_block_size);
>
> Please use the accessor functions when possible.
>
> bdev_logical_block_size(lc->header_location.bdev) to the rescue....
Ah right, thanks for the reminder!
v2 of the patch to follow...
Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-17 16:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-17 16:21 [PATCH] dm log: fix create_log_context() to use proper logical_block_size Mike Snitzer
2009-06-17 16:26 ` Martin K. Petersen
2009-06-17 16:29 ` Mike Snitzer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.