Skip to content

Commit 353e6d5

Browse files
gjoyce-ibmigaw
authored andcommitted
sed: perform a tper revert after lsp revert
The non-destructive revert was not sufficiently reverting the lsp. A TPER revert is required or the drive is only partially reverted. Signed-off-by: Greg Joyce <gjoyce@linux.ibm.com>
1 parent f100aa2 commit 353e6d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/sed/sedopal_cmd.c

+8
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,14 @@ int sedopal_cmd_revert(int fd)
398398
revert_lsp.__pad = 0;
399399

400400
rc = ioctl(fd, IOC_OPAL_REVERT_LSP, &revert_lsp);
401+
if (rc == 0) {
402+
/*
403+
* TPER must also be reverted.
404+
*/
405+
rc = ioctl(fd, IOC_OPAL_REVERT_TPR, &revert_lsp.key);
406+
if (rc != 0)
407+
fprintf(stderr, "Error: revert TPR - %d\n", rc);
408+
}
401409
#else
402410
rc = -EOPNOTSUPP;
403411
#endif

0 commit comments

Comments
 (0)