From patchwork Wed May 22 21:55:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 245733 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 489AD2C0082 for ; Thu, 23 May 2013 07:56:07 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UfH0r-0005Uf-7D; Wed, 22 May 2013 21:56:01 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UfH0I-0004xq-3E for kernel-team@lists.ubuntu.com; Wed, 22 May 2013 21:55:26 +0000 Received: from c-67-160-231-42.hsd1.ca.comcast.net ([67.160.231.42] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1UfH0G-0000zV-RT; Wed, 22 May 2013 21:55:25 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1UfH0E-0006NQ-PI; Wed, 22 May 2013 14:55:22 -0700 From: Kamal Mostafa To: Andy Grover Subject: [ 3.8.y.z extended stable ] Patch "target: Use FD_MAX_SECTORS/FD_BLOCKSIZE for blockdevs using fileio" has been added to staging queue Date: Wed, 22 May 2013 14:55:22 -0700 Message-Id: <1369259722-24481-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.1.2 X-Extended-Stable: 3.8 Cc: Kamal Mostafa , Eric Harney , Nicholas Bellinger , kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled target: Use FD_MAX_SECTORS/FD_BLOCKSIZE for blockdevs using fileio to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.8.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ------ From 16950321687f0047d8d922855a3d21006c8909f1 Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Fri, 26 Apr 2013 11:09:03 -0700 Subject: target: Use FD_MAX_SECTORS/FD_BLOCKSIZE for blockdevs using fileio commit e3e84cda321703b123f36488f50700f371bc7230 upstream. We can still see the error reported in https://patchwork.kernel.org/patch/2338981/ when using fileio backed by a block device. I'm assuming this will get us past that error (from sbc_parse_cdb), and also assuming it's OK to have our max_sectors be larger than the block's queue max hw sectors? Reported-by: Eric Harney Signed-off-by: Andy Grover Signed-off-by: Nicholas Bellinger [ kamal: backport to 3.8 ] Signed-off-by: Kamal Mostafa --- drivers/target/target_core_file.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 1.8.1.2 diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index b9c8849..89aa3b2a 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -151,10 +151,6 @@ static int fd_configure_device(struct se_device *dev) struct request_queue *q = bdev_get_queue(inode->i_bdev); unsigned long long dev_size; - dev->dev_attrib.hw_block_size = - bdev_logical_block_size(inode->i_bdev); - dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q); - /* * Determine the number of bytes from i_size_read() minus * one (1) logical sector from underlying struct block_device @@ -173,13 +169,12 @@ static int fd_configure_device(struct se_device *dev) " block_device\n"); goto fail; } - - dev->dev_attrib.hw_block_size = FD_BLOCKSIZE; - dev->dev_attrib.hw_max_sectors = FD_MAX_SECTORS; } fd_dev->fd_block_size = dev->dev_attrib.hw_block_size; + dev->dev_attrib.hw_block_size = FD_BLOCKSIZE; + dev->dev_attrib.hw_max_sectors = FD_MAX_SECTORS; dev->dev_attrib.hw_queue_depth = FD_MAX_DEVICE_QUEUE_DEPTH; if (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) {