]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix bug in handling of FILEIO + block_device resize ops
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 16 May 2012 23:05:26 +0000 (16:05 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 17 May 2012 19:02:43 +0000 (12:02 -0700)
commitee3be03ebb965db32f4d8e6fb38581690ebf7762
treea1e5045e68a8a081a2e932846a0bf951128d93db
parent0bc8b78c66027e97b5e43a5762f80ccf9b4ae7bc
target: Fix bug in handling of FILEIO + block_device resize ops

This patch fixes a bug in the handling of FILEIO w/ underlying block_device
resize operations where the original fd_dev->fd_dev_size was incorrectly being
used in fd_get_blocks() for READ_CAPACITY response payloads.

This patch avoids using fd_dev->fd_dev_size for FILEIO devices with
an underlying block_device, and instead changes fd_get_blocks() to
get the sector count directly from i_size_read() as recommended by hch.

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_file.c