[stgt] [PATCH] SMC: do not allow load/unload of media that has been pinned down with PreventAllowMediumRemoval

ronnie sahlberg ronniesahlberg at gmail.com
Mon Feb 6 11:38:41 CET 2012


List, Tomo, Mark

Thanks for the review.
I have changed the patch to only check the src slot on unload as Mark suggested.

regards
ronnie sahlberg


On Sun, Feb 5, 2012 at 3:18 PM, Mark Harvey <markh794 at gmail.com> wrote:
> On Sun, Feb 5, 2012 at 10:43 AM, ronnie sahlberg
> <ronniesahlberg at gmail.com> wrote:
>> List, Tomo
>>
>> Please find attached a small patch for SMC.
>> It now prevents the media changer commands from loading/unloading
>> media to a data transfer device IF that data transfer device has the
>> media removal prevention set via PreventAllowMediumRemoval.
>>
>> Initiators set this when they mount a device that is removable.
>>
>> For example if you have a removable SBC device like the sbc jukebox
>> example, Linux for example will set the PreventAllowMediumRemoval when
>> you:
>> mount -o ro,noload <device> <mountpoint>
>> just so that no one will eject the media while the filesystem is mounted.
>>
>> Similarly this also happens for MMC devices,   and I belive also on
>> SSC devices, but I cant check SSC devices.
>> (Mark, If I assume that backup applocations do use
>> PreventAllowMediumRemoval when they have loaded a tape into the dt
>> device?)
>>
>>
>> regards
>> ronnie sahlberg
>
> The IBM SCSI Reference (11th edition) states..
>
> ------------
> If the Prevent field is set, then eject requests from the front panel
> are ignored and
> Unload commands give Check Condition status. The Sense Key is set to Illegal
> Request and the ASC/ASCQ to Medium Removal Prevented (5302).
> All initiators that have prevented medium removal must enable it before the
> medium can be removed from the drive.
> -----------
>
> This patch also checks status on destination slot, which I think is a
> bit too aggressive.
> Checking on unload on source slot should be fine.
>
> Cheers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-SMC-Do-not-allow-load-unload-on-the-data-transfer-de.patch.gz
Type: application/x-gzip
Size: 1653 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20120206/2e860216/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-SMC-Do-not-allow-load-unload-on-the-data-transfer-de.patch
Type: text/x-diff
Size: 3731 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20120206/2e860216/attachment-0002.patch>


More information about the stgt mailing list