libiscsi: Clear PS bit before sending MODE SELECT

A quote from SPC-4: "When using the MODE SENSE command, a
parameters saveable (PS) bit set to one indicates that the mode
page may be saved by the logical unit in a nonvolatile, vendor
specific location. A PS bit set to zero indicates that the device
server is not able to save the supported parameters. When using
the MODE SELECT command, the PS bit is reserved."

Hence clear the PS bit after having queried a mode page via MODE
SENSE and before changing it via MODE SELECT.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2014-10-14 11:47:36 +02:00
committed by Ronnie Sahlberg
parent 14461757c4
commit 0763dc5743
2 changed files with 9 additions and 0 deletions

View File

@@ -206,6 +206,9 @@ int main(int argc, char *argv[])
goto finished;
}
/* For MODE SELECT PS is reserved and hence must be cleared */
mp->ps = 0;
printf("SWP:%d\n", mp->control.swp);
switch (swp) {