Skip to content

Commit 0cc2cae

Browse files
calebsanderigaw
authored andcommitted
ioctl: don't set SAVE bit on unsaveable features
According to the NVMe spec, the Host Behavior and Write Protection features are not saveable. Setting the SAVE bit may cause the Set Features command to be rejected, so don't set it for these features. Signed-off-by: Caleb Sander <[email protected]>
1 parent 019117e commit 0cc2cae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/nvme/ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ int nvme_set_features_host_behavior(int fd, bool save,
811811
.nsid = NVME_NSID_NONE,
812812
.cdw11 = 0,
813813
.cdw12 = 0,
814-
.save = save,
814+
.save = false,
815815
.uuidx = NVME_UUID_NONE,
816816
.cdw15 = 0,
817817
.data_len = sizeof(*data),
@@ -884,7 +884,7 @@ int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state,
884884
bool save, __u32 *result)
885885
{
886886
return __nvme_set_features(fd, NVME_FEAT_FID_WRITE_PROTECT, state,
887-
save, result);
887+
false, result);
888888
}
889889

890890
int nvme_set_features_iocs_profile(int fd, __u8 iocsi, bool save)

0 commit comments

Comments
 (0)