target: Don't allow setting WC emulation if device doesn't support
authorAndy Grover <agrover@redhat.com>
Wed, 14 May 2014 22:48:06 +0000 (15:48 -0700)
committerJiri Slaby <jslaby@suse.cz>
Mon, 9 Jun 2014 13:53:45 +0000 (15:53 +0200)
commit1b8b4d6d14a3704e221b0e580d93650903ab7038
treef4228a11adc596fbfdcfea906016e71f4f6a12f6
parent730cef687920282f8d7377006bd742d23a5eaf7e
target: Don't allow setting WC emulation if device doesn't support

commit 07b8dae38b09bcfede7e726f172e39b5ce8390d9 upstream.

Just like for pSCSI, if the transport sets get_write_cache, then it is
not valid to enable write cache emulation for it. Return an error.

see https://bugzilla.redhat.com/show_bug.cgi?id=1082675

Reviewed-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/target/target_core_device.c