Skip to content

Commit

Permalink
block/iscsi: store DPOFUA bit from the modesense command
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Lieven <pl@kamp.de>
Message-id: 1429193313-4263-5-git-send-email-pl@kamp.de
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
plieven authored and kevmw committed Apr 28, 2015
1 parent 7191f20 commit 752ce45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/iscsi.c
Expand Up @@ -66,6 +66,7 @@ typedef struct IscsiLun {
bool write_protected;
bool lbpme;
bool lbprz;
bool dpofua;
bool has_write_same;
} IscsiLun;

Expand Down Expand Up @@ -1258,6 +1259,7 @@ static void iscsi_modesense_sync(IscsiLun *iscsilun)
struct scsi_task *task;
struct scsi_mode_sense *ms = NULL;
iscsilun->write_protected = false;
iscsilun->dpofua = false;

task = iscsi_modesense6_sync(iscsilun->iscsi, iscsilun->lun,
1, SCSI_MODESENSE_PC_CURRENT,
Expand All @@ -1279,6 +1281,7 @@ static void iscsi_modesense_sync(IscsiLun *iscsilun)
goto out;
}
iscsilun->write_protected = ms->device_specific_parameter & 0x80;
iscsilun->dpofua = ms->device_specific_parameter & 0x10;

out:
if (task) {
Expand Down

0 comments on commit 752ce45

Please sign in to comment.