Bug 1082675 - targetcli set attribute emulate_write_cache=1 is ignored
targetcli set attribute emulate_write_cache=1 is ignored
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel (Show other bugs)
7.0
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Maurizio Lombardi
Bruno Goncalves
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-31 11:24 EDT by Eric Murphy
Modified: 2017-09-20 13:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Murphy 2014-03-31 11:24:23 EDT
Description of problem:
targetcli set attribute emulate_write_cache=1 is ignored


Version-Release number of selected component (if applicable):
Backstore plugin block v4.1.0-rc2-ml



How reproducible:
Always


Steps to Reproduce:
1. Create a block storage device in targetcli
2. Enter the block device and issue the command "set attribute emulate_write_cache=1"


Actual results:
Parameter emulate_write_cache is now '0'.


Expected results:
Parameter emulate_write_cache is now '1' 
Or an error message stating the reason why the change failed

Additional info:
/> cd backstores/block/TestSan01_block
/backstores/b...stSan01_block> ls
o- TestSan01_block ................................................................ [/dev/sda (136.7GiB) write-thru activated]
/backstores/b...stSan01_block> set attribute emulate_write_cache=1
Parameter emulate_write_cache is now '0'.
Comment 2 Eric Murphy 2014-03-31 13:00:16 EDT
The change being ignored is not a bug, I found more information in journalctl.  There should still be more information about why the change was ignored from within the targetcli program.

From journalctl:

Mar 31 10:19:18 testsan01.localhost.local kernel: emulate_write_cache cannot be changed when underlying HW reports WriteCacheEnabled, ignoring request
Comment 3 Andy Grover 2014-03-31 16:19:32 EDT
The kernel code is returning a success error value but printing that message, so there's no way for targetcli to know anything went wrong. We probably want to change the kernel to return an error code (EINVAL) in this case.

Note You need to log in before you can comment on or make changes to this bug.