[stgt] [PATCH] Add support for SoftwareWriteProtect and fix bugs in modeselect

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Sun Jul 7 10:35:44 CEST 2013


On Sat,  6 Jul 2013 23:13:16 -0700
Ronnie Sahlberg <ronniesahlberg at gmail.com> wrote:

> Fix a bug in sbc_mode_page_update. We only have a subpagecode in byte 1
> IFF the SPF bit in byte 0 is set.
> 
> Add support for using modeselect for the CONTROLS page and set the
> mask to allow SWP to be changed.
> 
> Add a SWP flag to the device attributes and update this as the CONTROLS/SWP
> flag is set by the initiator.
> 
> Update SBC so that we treat writeprotect as either the current ->readonly flag
> that is used to se the hard property for the lun,   or the ->swp flag
> that is set in software by the initiators.
> Thus like on a real disk, SWP can be used to turn a read-write LUN to become
> temporarily readonly, but SWP can NOT be used to turn a physically readonly
> medium to become read-write.
> 
> Signed-off-by: Ronnie Sahlberg <ronniesahlberg at gmail.com>
> ---
>  usr/sbc.c    |   37 +++++++++++++++++++++++++++++++------
>  usr/spc.c    |    1 +
>  usr/target.c |    2 ++
>  usr/tgtd.h   |    1 +
>  4 files changed, 35 insertions(+), 6 deletions(-)

Looks good. Applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list