Skip to content

Commit

Permalink
[SCSI] qla4xxx: Restrict logout from boot target session using sessio…
Browse files Browse the repository at this point in the history
…n id

Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Adheer Chandravanshi authored and James Bottomley committed Apr 11, 2013
1 parent 039acc1 commit 37719c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -5916,6 +5916,14 @@ static int qla4xxx_sysfs_ddb_logout_sid(struct iscsi_cls_session *cls_sess)
goto exit_ddb_logout;
}

if (test_bit(DF_BOOT_TGT, &ddb_entry->flags)) {
ql4_printk(KERN_ERR, ha,
"%s: Logout from boot target entry is not permitted.\n",
__func__);
ret = -EPERM;
goto exit_ddb_logout;
}

options = LOGOUT_OPTION_CLOSE_SESSION;
if (qla4xxx_session_logout_ddb(ha, ddb_entry, options) == QLA_ERROR) {
ql4_printk(KERN_ERR, ha, "%s: Logout failed\n", __func__);
Expand Down

0 comments on commit 37719c2

Please sign in to comment.