[3.8.y.z,extended,stable] Patch "target: Use FD_MAX_SECTORS/FD_BLOCKSIZE for blockdevs using fileio" has been added to staging queue

Message ID 1369259722-24481-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa May 22, 2013, 9:55 p.m.
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:


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



From 16950321687f0047d8d922855a3d21006c8909f1 Mon Sep 17 00:00:00 2001
From: Andy Grover <agrover@redhat.com>
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


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 <eharney@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ kamal: backport to 3.8 ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
 drivers/target/target_core_file.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)



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) {