From: Adheer Chandravanshi Date: Fri, 5 Apr 2013 11:06:07 +0000 (-0400) Subject: [SCSI] qla4xxx: Restrict logout from boot target session using session id X-Git-Tag: firefly_0821_release~3680^2~632^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=37719c2a54caff1f3d7861a17e06327f74002bb2;p=firefly-linux-kernel-4.4.55.git [SCSI] qla4xxx: Restrict logout from boot target session using session id Signed-off-by: Adheer Chandravanshi Signed-off-by: Vikas Chaudhary Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 5f7a2bc32069..f82efcb82684 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -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__);