From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1I8Q9G-0007yj-3r for user-mode-linux-devel@lists.sourceforge.net; Tue, 10 Jul 2007 17:33:47 -0700 Received: from saraswathi.solana.com ([198.99.130.12]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1I8Q9D-0000VJ-6W for user-mode-linux-devel@lists.sourceforge.net; Tue, 10 Jul 2007 17:33:40 -0700 Date: Tue, 10 Jul 2007 12:49:02 -0400 From: Jeff Dike Message-ID: <20070710164902.GA7820@c2.user-mode-linux.org> Mime-Version: 1.0 Content-Disposition: inline Subject: [uml-devel] [PATCH] UML - limit requests on COW devices to 32 sectors List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: user-mode-linux-devel-bounces@lists.sourceforge.net Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net To: stable@kernel.org Cc: LKML , uml-devel COWed devices can't handle more than 32 (64 on x86_64) sectors in one request due to the size of the bitmap being carried around in the io_thread_req. Enforce that by telling the block layer not to put too many sectors in requests to COWed devices. Signed-off-by: Jeff Dike -- arch/um/drivers/ubd_kern.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6.17/arch/um/drivers/ubd_kern.c =================================================================== --- linux-2.6.17.orig/arch/um/drivers/ubd_kern.c 2007-07-09 08:53:09.000000000 -0400 +++ linux-2.6.17/arch/um/drivers/ubd_kern.c 2007-07-09 18:08:33.000000000 -0400 @@ -712,6 +712,8 @@ static int ubd_add(int n, char **error_o ubd_dev->queue->queuedata = ubd_dev; blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); + if(ubd_dev->cow.file != NULL) + blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long)); err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]); if(err){ *error_out = "Failed to register device"; ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764679AbXGKAdw (ORCPT ); Tue, 10 Jul 2007 20:33:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759761AbXGKAdn (ORCPT ); Tue, 10 Jul 2007 20:33:43 -0400 Received: from saraswathi.solana.com ([198.99.130.12]:38259 "EHLO saraswathi.solana.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759738AbXGKAdm (ORCPT ); Tue, 10 Jul 2007 20:33:42 -0400 Date: Tue, 10 Jul 2007 12:49:02 -0400 From: Jeff Dike To: stable@kernel.org Cc: LKML , uml-devel Subject: [PATCH] UML - limit requests on COW devices to 32 sectors Message-ID: <20070710164902.GA7820@c2.user-mode-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org COWed devices can't handle more than 32 (64 on x86_64) sectors in one request due to the size of the bitmap being carried around in the io_thread_req. Enforce that by telling the block layer not to put too many sectors in requests to COWed devices. Signed-off-by: Jeff Dike -- arch/um/drivers/ubd_kern.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6.17/arch/um/drivers/ubd_kern.c =================================================================== --- linux-2.6.17.orig/arch/um/drivers/ubd_kern.c 2007-07-09 08:53:09.000000000 -0400 +++ linux-2.6.17/arch/um/drivers/ubd_kern.c 2007-07-09 18:08:33.000000000 -0400 @@ -712,6 +712,8 @@ static int ubd_add(int n, char **error_o ubd_dev->queue->queuedata = ubd_dev; blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); + if(ubd_dev->cow.file != NULL) + blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long)); err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]); if(err){ *error_out = "Failed to register device";