]> 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)
commit110921fe48eeee672142fa491271edb3cd706618
tree7edb86180f5b093cbef210562af8712d2d98d7fa
parent26ea0e51f464ea1feadef8b1424be22aff145290
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