Skip to content
Commit 9bc6548f authored by Christophe Vu-Brugier's avatar Christophe Vu-Brugier Committed by Nicholas Bellinger
Browse files

target: do not reject FUA CDBs when write cache is enabled but emulate_write_cache is 0



A check that rejects a CDB with FUA bit set if no write cache is
emulated was added by the following commit:

  fde9f50f target: Add sanity checks for DPO/FUA bit usage

The condition is as follows:

  if (!dev->dev_attrib.emulate_fua_write ||
      !dev->dev_attrib.emulate_write_cache)

However, this check is wrong if the backend device supports WCE but
"emulate_write_cache" is disabled.

This patch uses se_dev_check_wce() (previously named
spc_check_dev_wce) to invoke transport->get_write_cache() if the
device has a write cache or check the "emulate_write_cache" attribute
otherwise.

Reported-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarChristophe Vu-Brugier <cvubrugier@fastmail.fm>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 5f7da044
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment