Skip to content

Commit 9ec041e

Browse files
blucaaxboe
authored andcommitted
sed-opal: add support flag for SUM in status ioctl
Not every OPAL drive supports SUM (Single User Mode), so report this information to userspace via the get-status ioctl so that we can adjust the formatting options accordingly. Tested on a kingston drive (which supports it) and a samsung one (which does not). Signed-off-by: Luca Boccassi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 0aa2988 commit 9ec041e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

block/sed-opal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ static int opal_discovery0_end(struct opal_dev *dev)
487487
break;
488488
case FC_SINGLEUSER:
489489
single_user = check_sum(body->features);
490+
if (single_user)
491+
dev->flags |= OPAL_FL_SUM_SUPPORTED;
490492
break;
491493
case FC_GEOMETRY:
492494
check_geometry(dev, body);

include/uapi/linux/sed-opal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ struct opal_read_write_table {
144144
#define OPAL_FL_LOCKED 0x00000008
145145
#define OPAL_FL_MBR_ENABLED 0x00000010
146146
#define OPAL_FL_MBR_DONE 0x00000020
147+
#define OPAL_FL_SUM_SUPPORTED 0x00000040
147148

148149
struct opal_status {
149150
__u32 flags;

0 commit comments

Comments
 (0)