From patchwork Wed Jun 17 16:21:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 30913 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5HGLu8J031758 for ; Wed, 17 Jun 2009 16:21:56 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 3F7CE619EB0; Wed, 17 Jun 2009 12:21:55 -0400 (EDT) Received: from int-mx2.corp.redhat.com ([172.16.27.26]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n5HGLrnB004680 for ; Wed, 17 Jun 2009 12:21:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5HGLrFu011251 for ; Wed, 17 Jun 2009 12:21:53 -0400 Received: from localhost (dhcp-100-18-171.bos.redhat.com [10.16.18.171]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5HGLqeZ019014 for ; Wed, 17 Jun 2009 12:21:52 -0400 From: Mike Snitzer To: dm-devel@redhat.com Date: Wed, 17 Jun 2009 12:21:52 -0400 Message-Id: <1245255712-5320-1-git-send-email-snitzer@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH] dm log: fix create_log_context() to use proper logical_block_size X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 --- drivers/md/dm-log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel 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",