Skip to content

Commit

Permalink
Check MAP open if moving media from MAP to drive
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Mark Harvey <markh794@gmail.com>
  • Loading branch information
Sebastian Herbszt authored and markh794 committed Jun 1, 2011
1 parent e6e0048 commit 8e4792e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions usr/smc.c
Expand Up @@ -1032,6 +1032,14 @@ static int move_slot2drive(struct smc_priv *smc_p,
mkSenseBuf(ILLEGAL_REQUEST, E_MEDIUM_DEST_FULL, sam_stat);
return SAM_STAT_CHECK_CONDITION;
}
if (src->element_type == MAP_ELEMENT) {
if (!map_access_ok(smc_p, src)) {
MHVTL_DBG(2, "SOURCE MAP port not accessable");
mkSenseBuf(ILLEGAL_REQUEST, E_MEDIUM_REMOVAL_PREVENTED,
sam_stat);
return SAM_STAT_CHECK_CONDITION;
}
}

sprintf(cmd, "lload %s", src->media->barcode);
/* Remove traling spaces */
Expand Down

0 comments on commit 8e4792e

Please sign in to comment.