Commit 4925c7e22293dbf2b85351e8c2323ad8282396b3
Committed by
Martin Schwidefsky
1 parent
9c9c17613a
Exists in
master
and in
39 other branches
[S390] tape: Compression overwrites crypto setting
After switching compression on/off with the mt command, tape encryption is no longer working. The reason for that is, that the modeset_byte is set to the compression value instead of using bitwise and/or bit operations to enable/disable the corresponding bit. Signed-off-by: Michael Holzheu <holzheu@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff
drivers/s390/char/tape_std.c
... | ... | @@ -647,7 +647,10 @@ |
647 | 647 | return PTR_ERR(request); |
648 | 648 | request->op = TO_NOP; |
649 | 649 | /* setup ccws */ |
650 | - *device->modeset_byte = (mt_count == 0) ? 0x00 : 0x08; | |
650 | + if (mt_count == 0) | |
651 | + *device->modeset_byte &= ~0x08; | |
652 | + else | |
653 | + *device->modeset_byte |= 0x08; | |
651 | 654 | tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); |
652 | 655 | tape_ccw_end(request->cpaddr + 1, NOP, 0, NULL); |
653 | 656 | /* execute it */ |