]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 May 2012 17:46:21 +0000 (10:46 -0700)
commitc52d567fdf7fb8cdaf2d34206f5b7f4adaae1595
tree1de62aa5e0dfcea203692d37bd307be152556047
parent2307b85fbe257c0348f56118d533769d36c9cc8a
target: Fix bug in handling of FILEIO + block_device resize ops

commit cd9323fd68aee3c1c6b5b21e5746c9d1b586fb58 upstream.

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>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_file.c