scsi: scsi_debug: fix write_same with virtual_gb problem
authorDouglas Gilbert <dgilbert@interlog.com>
Fri, 25 Jan 2019 17:46:09 +0000 (12:46 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:02:30 +0000 (14:02 -0700)
commit8d27f830b6159c687e704e98a96133e746a9ed22
tree707e93072abdd43602fd8918f8cb609df3ed8ad0
parente546c8787e7b3d400dbb2aacb95b66438bcaa86e
scsi: scsi_debug: fix write_same with virtual_gb problem

[ Upstream commit 40d07b523cf434f252b134c86b1f8f2d907ffb0b ]

The WRITE SAME(10) and (16) implementations didn't take account of the
buffer wrap required when the virtual_gb parameter is greater than 0.

Fix that and rename the fake_store() function to lba2fake_store() to lessen
confusion with the global fake_storep pointer. Bump version date.

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Reported-by: Bart Van Assche <bvanassche@acm.org>
Tested by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_debug.c