diff options
author | Andy Grover <agrover@redhat.com> | 2013-04-26 11:09:03 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-19 11:38:47 -0700 |
commit | 8cb3a88522df20a6d77934260040facfc0449f0e (patch) | |
tree | 7414ad5a0a5ec5758522aea9d1730f879827ac80 | |
parent | 60106c06452e7db66d13ce8286d89b9cce13664d (diff) | |
download | lwn-8cb3a88522df20a6d77934260040facfc0449f0e.tar.gz lwn-8cb3a88522df20a6d77934260040facfc0449f0e.zip |
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 <eharney@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/target/target_core_file.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 17a6acbc3ab0..ca4b2193e05c 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -148,13 +148,8 @@ static int fd_configure_device(struct se_device *dev) */ inode = file->f_mapping->host; if (S_ISBLK(inode->i_mode)) { - 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 +168,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) { |