From patchwork Fri Sep 18 19:28:56 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: 48594 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 n8IJTJqd002755 for ; Fri, 18 Sep 2009 19:29:19 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 4D20E6193AD; Fri, 18 Sep 2009 15:29:18 -0400 (EDT) Received: from int-mx05.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 n8IJTGgL023937 for ; Fri, 18 Sep 2009 15:29:16 -0400 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8IJTCkw032573; Fri, 18 Sep 2009 15:29:12 -0400 Received: from rgminet12.oracle.com (rcsinet12.oracle.com [148.87.113.124]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8IJT41M014696; Fri, 18 Sep 2009 15:29:05 -0400 Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8IJSl0q005754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Sep 2009 19:28:48 GMT Received: from abhmt001.oracle.com (abhmt001.oracle.com [141.146.116.10]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8IJT0G4016451; Fri, 18 Sep 2009 19:29:01 GMT Received: from groovelator.mkp.net (/209.217.122.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Sep 2009 12:28:57 -0700 To: device-mapper development Subject: Re: [dm-devel] [PATCH 1/3] block: Add blk_queue_copy_limits() From: "Martin K. Petersen" Organization: Oracle References: <4AB3B43D.9000802@ce.jp.nec.com> Date: Fri, 18 Sep 2009 15:28:56 -0400 In-Reply-To: <4AB3B43D.9000802@ce.jp.nec.com> (Jun'ichi Nomura's message of "Sat, 19 Sep 2009 01:24:29 +0900") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Source-IP: abhmt001.oracle.com [141.146.116.10] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090204.4AB3DF7C.0038:SCFSTAT5015188,ss=1,fgs=0 X-RedHat-Spam-Score: -103.999 (RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY, USER_IN_WHITELIST) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.11 X-loop: dm-devel@redhat.com Cc: linux-kernel@vger.kernel.org, Alasdair G Kergon , "Martin K. Petersen" , Mike Snitzer , Jens Axboe 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 >>>>> "Jun'ichi" == Jun'ichi Nomura writes: + if (q->limits.max_sectors == 0 || q->limits.max_hw_sectors == 0) + blk_queue_max_sectors(q, SAFE_MAX_SECTORS); I'm really not keen on perpetuating SAFE_MAX_SECTORS for something that was written in this millennium. I'd much rather we just do this, then: block: Set max_sectors correctly for stacking devices The topology changes unintentionally caused SAFE_MAX_SECTORS to be set for stacking devices. Set the default limit to BLK_DEF_MAX_SECTORS and provide SAFE_MAX_SECTORS in blk_queue_make_request() for legacy hw drivers that depend on the old behavior. Signed-off-by: Martin K. Petersen Acked-by: Mike Snitzer --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/block/blk-settings.c b/block/blk-settings.c index 83413ff..cd9b730 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -111,7 +111,7 @@ void blk_set_default_limits(struct queue_limits *lim) lim->max_hw_segments = MAX_HW_SEGMENTS; lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK; lim->max_segment_size = MAX_SEGMENT_SIZE; - lim->max_sectors = lim->max_hw_sectors = SAFE_MAX_SECTORS; + lim->max_sectors = lim->max_hw_sectors = BLK_DEF_MAX_SECTORS; lim->logical_block_size = lim->physical_block_size = lim->io_min = 512; lim->bounce_pfn = (unsigned long)(BLK_BOUNCE_ANY >> PAGE_SHIFT); lim->alignment_offset = 0; @@ -164,6 +164,7 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn) q->unplug_timer.data = (unsigned long)q; blk_set_default_limits(&q->limits); + blk_queue_max_sectors(q, SAFE_MAX_SECTORS); /* * If the caller didn't supply a lock, fall back to our embedded