]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix SYNCHRONIZE_CACHE zero LBA + range breakage
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 11 Aug 2011 01:41:14 +0000 (18:41 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 22 Aug 2011 19:26:25 +0000 (19:26 +0000)
commitbbe48f8e23a5d03d8ea1304c5598234518ea229f
tree7edb86180f5b093cbef210562af8712d2d98d7fa
parentfab061145ecb5a793a61b039e1c7716781aefb98
target: Fix SYNCHRONIZE_CACHE zero LBA + range breakage

This patch fixes a SYNCHRONIZE_CACHE CDB handling bug with IBLOCK/FILEIO
backends where transport_cmd_get_valid_sectors() was incorrectly rejecting
a zero LBA + range CDB from being processed, and returning CHECK_CONDITION.

This includes changing transport_cmd_get_valid_sectors() to return '0' on
success and '-EINVAL' on failure (this makes more sense than sectors),
and to only check transport_cmd_get_valid_sectors() when a non zero LBA +
range SYNCHRONIZE_CACHE operation has been receieved for the non passthrough
case.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c