From: Greg Kroah-Hartman Date: Fri, 17 May 2013 21:18:37 +0000 (-0700) Subject: 3.9-stable patches X-Git-Tag: v3.0.79~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9dc75649af244e658fc7ad1720d9587d5719866c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.9-stable patches added patches: target-use-fd_max_sectors-fd_blocksize-for-blockdevs-using-fileio.patch --- diff --git a/queue-3.9/series b/queue-3.9/series index 09dc1d23964..76328bb4985 100644 --- a/queue-3.9/series +++ b/queue-3.9/series @@ -99,3 +99,4 @@ parisc-use-long-branch-in-fork_like-macro.patch parisc-fix-native-set-up-in-build.patch parisc-make-default-cross-compiler-search-more-robust-v3.patch audit-make-testing-for-a-valid-loginuid-explicit.patch +target-use-fd_max_sectors-fd_blocksize-for-blockdevs-using-fileio.patch diff --git a/queue-3.9/target-use-fd_max_sectors-fd_blocksize-for-blockdevs-using-fileio.patch b/queue-3.9/target-use-fd_max_sectors-fd_blocksize-for-blockdevs-using-fileio.patch new file mode 100644 index 00000000000..c1622db7351 --- /dev/null +++ b/queue-3.9/target-use-fd_max_sectors-fd_blocksize-for-blockdevs-using-fileio.patch @@ -0,0 +1,61 @@ +From e3e84cda321703b123f36488f50700f371bc7230 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 + +From: Andy Grover + +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 +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/target/target_core_file.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +--- 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 + */ + 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 + " 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) {