Blame SOURCES/0022-scsi-scsi-qla2xxx-Prevent-SysFS-access-when-chip-is-.patch

3d7c23
From 9325cac8c04c9f251771e8c55c46c34a6dd79a68 Mon Sep 17 00:00:00 2001
3d7c23
From: Himanshu Madhani <hmadhani@redhat.com>
3d7c23
Date: Thu, 1 Aug 2019 15:54:42 -0400
3d7c23
Subject: [PATCH 022/124] [scsi] scsi: qla2xxx: Prevent SysFS access when chip
3d7c23
 is down
3d7c23
3d7c23
Message-id: <20190801155618.12650-23-hmadhani@redhat.com>
3d7c23
Patchwork-id: 267817
3d7c23
O-Subject: [RHEL 7.8 e-stor PATCH 022/118] scsi: qla2xxx: Prevent SysFS access when chip is down
3d7c23
Bugzilla: 1729270
3d7c23
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
3d7c23
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
3d7c23
3d7c23
From: Quinn Tran <qtran@marvell.com>
3d7c23
3d7c23
Bugzilla 1729270
3d7c23
3d7c23
Prevent user from sending commands through sysfs while FW is not running or
3d7c23
reset is in progress.
3d7c23
3d7c23
Signed-off-by: Quinn Tran <qtran@marvell.com>
3d7c23
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
3d7c23
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3d7c23
(cherry picked from commit b726d99d72fd4b36ae82efb35d0073b0c9441205)
3d7c23
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
3d7c23
Signed-off-by: Jan Stancek <jstancek@redhat.com>
3d7c23
---
3d7c23
 drivers/scsi/qla2xxx/qla_attr.c | 3 +++
3d7c23
 1 file changed, 3 insertions(+)
3d7c23
3d7c23
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
3d7c23
index 037016290044..2e168fb19531 100644
3d7c23
--- a/drivers/scsi/qla2xxx/qla_attr.c
3d7c23
+++ b/drivers/scsi/qla2xxx/qla_attr.c
3d7c23
@@ -543,6 +543,9 @@ qla2x00_sysfs_write_vpd(struct file *filp, struct kobject *kobj,
3d7c23
 	if (unlikely(pci_channel_offline(ha->pdev)))
3d7c23
 		return 0;
3d7c23
 
3d7c23
+	if (qla2x00_chip_is_down(vha))
3d7c23
+		return 0;
3d7c23
+
3d7c23
 	if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size ||
3d7c23
 	    !ha->isp_ops->write_nvram)
3d7c23
 		return 0;
3d7c23
-- 
3d7c23
2.13.6
3d7c23