Skip to content
Commit 21363ca8 authored by Nicholas Bellinger's avatar Nicholas Bellinger
Browse files

target/file: Fix off-by-one READ_CAPACITY bug for !S_ISBLK export



This patch fixes a bug where FILEIO was incorrectly reporting the number
of logical blocks (+ 1) when using non struct block_device export mode.

It changes fd_get_blocks() to follow all other backend ->get_blocks() cases,
and reduces the calculated dev_size by one dev->dev_attrib.block_size
number of bytes, and also fixes initial fd_block_size assignment at
fd_configure_device() time introduced in commit 0fd97ccf.

Reported-by: default avatarWenchao Xia <xiawenc@linux.vnet.ibm.com>
Reported-by: default avatarBadari Pulavarty <pbadari@us.ibm.com>
Tested-by: default avatarBadari Pulavarty <pbadari@us.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 1d19f780
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment