Skip to content
Commit 785fea49 authored by David Kozub's avatar David Kozub Committed by Paul Gortmaker
Browse files

block: sed-opal: fix IOC_OPAL_ENABLE_DISABLE_MBR

commit 78bf4735

 upstream.

The implementation of IOC_OPAL_ENABLE_DISABLE_MBR handled the value
opal_mbr_data.enable_disable incorrectly: enable_disable is expected
to be one of OPAL_MBR_ENABLE(0) or OPAL_MBR_DISABLE(1). enable_disable
was passed directly to set_mbr_done and set_mbr_enable_disable where
is was interpreted as either OPAL_TRUE(1) or OPAL_FALSE(0). The end
result was that calling IOC_OPAL_ENABLE_DISABLE_MBR with OPAL_MBR_ENABLE
actually disabled the shadow MBR and vice versa.

This patch adds correct conversion from OPAL_MBR_DISABLE/ENABLE to
OPAL_FALSE/TRUE. The change affects existing programs using
IOC_OPAL_ENABLE_DISABLE_MBR but this is typically used only once when
setting up an Opal drive.

Acked-by: default avatarJon Derrick <jonathan.derrick@intel.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarScott Bauer <sbauer@plzdonthack.me>
Signed-off-by: default avatarDavid Kozub <zub@linux.fjfi.cvut.cz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 61afa515
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment