From patchwork Fri Dec 18 07:30:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 68620 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI7VHXo028635 for ; Fri, 18 Dec 2009 07:31:17 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 7198C8E031F; Fri, 18 Dec 2009 02:31:17 -0500 (EST) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id nBI7VFxu019281 for ; Fri, 18 Dec 2009 02:31:15 -0500 Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.7]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBI7VFlU011853; Fri, 18 Dec 2009 02:31:15 -0500 Received: from rcsinet12.oracle.com (rcsinet12.oracle.com [148.87.113.124]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBI7V0g1015776; Fri, 18 Dec 2009 02:31:00 -0500 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet12.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id nBI7UvX3000579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Dec 2009 07:30:58 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nBI5aNrD018984; Fri, 18 Dec 2009 07:31:27 GMT Received: from abhmt013.oracle.com by acsmt357.oracle.com with ESMTP id 1101698701261121454; Fri, 18 Dec 2009 01:30:54 -0600 Received: from groovelator.mkp.net (/209.217.122.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 17 Dec 2009 23:30:53 -0800 To: device-mapper development , Mike Snitzer From: "Martin K. Petersen" Organization: Oracle Date: Fri, 18 Dec 2009 02:30:51 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Auth-Type: Internal IP X-Source-IP: acsinet15.oracle.com [141.146.126.227] X-CT-RefId: str=0001.0A090203.4B2B2FB3.0101:SCFMA922111,ss=1,fgs=0 X-RedHat-Spam-Score: -103.794 (AWL, RCVD_IN_DNSWL_MED, SUBJECT_FUZZY_TION, UNPARSEABLE_RELAY, USER_IN_WHITELIST) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.7 X-loop: dm-devel@redhat.com Cc: jens.axboe@oracle.com Subject: [dm-devel] [PATCH] dm: Fix alignment stacking on partitioned devices 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 diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index be62547..67efac9 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -495,6 +495,7 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, struct queue_limits *limits = data; struct block_device *bdev = dev->bdev; struct request_queue *q = bdev_get_queue(bdev); + sector_t offset = (get_start_sect(bdev) + start) << 9; char b[BDEVNAME_SIZE]; if (unlikely(!q)) { @@ -503,7 +504,7 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, return 0; } - if (blk_stack_limits(limits, &q->limits, start << 9) < 0) + if (blk_stack_limits(limits, &q->limits, offset) < 0) DMWARN("%s: target device %s is misaligned: " "physical_block_size=%u, logical_block_size=%u, " "alignment_offset=%u, start=%llu", @@ -511,7 +512,7 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, q->limits.physical_block_size, q->limits.logical_block_size, q->limits.alignment_offset, - (unsigned long long) start << 9); + (unsigned long long) offset); /*