target: Allow non-supporting backends to set pi_prot_type to 0
authorAndy Grover <agrover@redhat.com>
Tue, 15 Apr 2014 21:13:12 +0000 (14:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 17:28:24 +0000 (10:28 -0700)
commitde162a48287592f93d3cc3a3af5a130d1fd648c7
treead3d8f332a850ec2b84a83b4acb75c526204ab0c
parent4d1a31078295f5aacb92bb313c6cd989f9d6742f
target: Allow non-supporting backends to set pi_prot_type to 0

commit 448ba904160f9d8f69217c28a1692cee5afbff88 upstream.

Userspace tools assume if a value is read from configfs, it is valid
and will not cause an error if the same value is written back. The only
valid value for pi_prot_type for backends not supporting DIF is 0, so allow
this particular value to be set without returning an error.

Reported-by: Krzysztof Chojnowski <frirajder@gmail.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_device.c