From patchwork Wed Apr 27 09:52:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Thornber X-Patchwork-Id: 736261 Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3R9tINN002030 for ; Wed, 27 Apr 2011 09:55:45 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3R9qvDc013637; Wed, 27 Apr 2011 05:52:58 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3R9quaP025267 for ; Wed, 27 Apr 2011 05:52:56 -0400 Received: from [10.36.9.48] (vpn2-9-48.ams2.redhat.com [10.36.9.48]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3R9qnIn009805; Wed, 27 Apr 2011 05:52:50 -0400 From: Joe Thornber To: Christoph Hellwig In-Reply-To: <20110427093259.GA24141@infradead.org> References: <20110426184742.GA13880@infradead.org> <1303895339.4679.51.camel@ubuntu> <20110427093259.GA24141@infradead.org> Date: Wed, 27 Apr 2011 10:52:44 +0100 Message-ID: <1303897964.4679.56.camel@ubuntu> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, ejt@redhat.com Subject: Re: [dm-devel] dm-thinp bug X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Apr 2011 09:58:01 +0000 (UTC) On Wed, 2011-04-27 at 05:32 -0400, Christoph Hellwig wrote: > > This patch already creashes when creating the table: Sigh, it's revealed a bug in io_hints, which isn't ever run if there's no iterate_devices callback. The patch below has been regression tested, but not tried above a virtio device. It's been pushed too. - Joe /* Thinp pool control target interface. */ @@ -659,6 +667,7 @@ static struct target_type thinp_target = { .status = thinp_status, .merge = thinp_bvec_merge, .io_hints = thinp_io_hints, + .iterate_devices = thinp_iterate_devices, }; static int __init dm_thinp_init(void) --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/drivers/md/dm-thin-prov.c b/drivers/md/dm-thin-prov.c index 6ac802e..a168ee6 100644 --- a/drivers/md/dm-thin-prov.c +++ b/drivers/md/dm-thin-prov.c @@ -641,7 +641,15 @@ thinp_io_hints(struct dm_target *ti, struct queue_limits *limits) struct thinp_c *tc = ti->private; blk_limits_io_min(limits, 0); - blk_limits_io_opt(limits, data_dev_block_size(tc)); + blk_limits_io_opt(limits, tc->block_size << tc->block_shift); +} + +static int thinp_iterate_devices(struct dm_target *ti, + iterate_devices_callout_fn fn, + void *data) +{ + struct thinp_c *tc = ti->private; + return fn(ti, tc->data_dev, 0, tc->data_size << tc->block_shift, data); }