+ scsi-qla2xxx-handle-sysfs-errors.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     SCSI/qla2xxx: handle sysfs errors

has been added to the -mm tree.  Its filename is

     scsi-qla2xxx-handle-sysfs-errors.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: SCSI/qla2xxx: handle sysfs errors
From: Jeff Garzik <jeff@xxxxxxxxxx>

Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx>
Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxx>
Cc: Francois Romieu <romieu@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/scsi/qla2xxx/qla_attr.c |   50 ++++++++++++++++++++++++------
 drivers/scsi/qla2xxx/qla_gbl.h  |    4 --
 drivers/scsi/qla2xxx/qla_os.c   |    7 +++-
 3 files changed, 47 insertions(+), 14 deletions(-)

diff -puN drivers/scsi/qla2xxx/qla_attr.c~scsi-qla2xxx-handle-sysfs-errors drivers/scsi/qla2xxx/qla_attr.c
--- a/drivers/scsi/qla2xxx/qla_attr.c~scsi-qla2xxx-handle-sysfs-errors
+++ a/drivers/scsi/qla2xxx/qla_attr.c
@@ -379,22 +379,52 @@ static struct bin_attribute sysfs_sfp_at
 	.read = qla2x00_sysfs_read_sfp,
 };
 
-void
+int
 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
 {
 	struct Scsi_Host *host = ha->host;
+	int rc;
 
-	sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
-	sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
-	sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
-	sysfs_create_bin_file(&host->shost_gendev.kobj,
-	    &sysfs_optrom_ctl_attr);
+	rc = sysfs_create_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_fw_dump_attr);
+	if (rc) goto err;
+	rc = sysfs_create_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_nvram_attr);
+	if (rc) goto err_fwd;
+	rc = sysfs_create_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_optrom_attr);
+	if (rc) goto err_nvr;
+	rc = sysfs_create_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_optrom_ctl_attr);
+	if (rc) goto err_optrom;
 	if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
-		sysfs_create_bin_file(&host->shost_gendev.kobj,
-		    &sysfs_vpd_attr);
-		sysfs_create_bin_file(&host->shost_gendev.kobj,
-		    &sysfs_sfp_attr);
+		rc = sysfs_create_bin_file(&host->shost_gendev.kobj,
+					   &sysfs_vpd_attr);
+		if (rc) goto err_opt_ctl;
+		rc = sysfs_create_bin_file(&host->shost_gendev.kobj,
+					   &sysfs_sfp_attr);
+		if (rc) goto err_vpd;
 	}
+
+	return 0;
+
+err_vpd:
+	sysfs_remove_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_vpd_attr);
+err_opt_ctl:
+	sysfs_remove_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_optrom_ctl_attr);
+err_optrom:
+	sysfs_remove_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_optrom_attr);
+err_nvr:
+	sysfs_remove_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_nvram_attr);
+err_fwd:
+	sysfs_remove_bin_file(&host->shost_gendev.kobj,
+				   &sysfs_fw_dump_attr);
+err:
+	return rc;
 }
 
 void
diff -puN drivers/scsi/qla2xxx/qla_gbl.h~scsi-qla2xxx-handle-sysfs-errors drivers/scsi/qla2xxx/qla_gbl.h
--- a/drivers/scsi/qla2xxx/qla_gbl.h~scsi-qla2xxx-handle-sysfs-errors
+++ a/drivers/scsi/qla2xxx/qla_gbl.h
@@ -296,9 +296,7 @@ struct class_device_attribute;
 extern struct class_device_attribute *qla2x00_host_attrs[];
 struct fc_function_template;
 extern struct fc_function_template qla2xxx_transport_functions;
-extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
+extern int qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
 extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
 extern void qla2x00_init_host_attr(scsi_qla_host_t *);
-extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
-extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
 #endif /* _QLA_GBL_H */
diff -puN drivers/scsi/qla2xxx/qla_os.c~scsi-qla2xxx-handle-sysfs-errors drivers/scsi/qla2xxx/qla_os.c
--- a/drivers/scsi/qla2xxx/qla_os.c~scsi-qla2xxx-handle-sysfs-errors
+++ a/drivers/scsi/qla2xxx/qla_os.c
@@ -1638,7 +1638,9 @@ qla2x00_probe_one(struct pci_dev *pdev, 
 	if (ret)
 		goto probe_failed;
 
-	qla2x00_alloc_sysfs_attr(ha);
+	ret = qla2x00_alloc_sysfs_attr(ha);
+	if (ret)
+		goto probe_failed_rmhost;
 
 	qla2x00_init_host_attr(ha);
 
@@ -1658,6 +1660,9 @@ qla2x00_probe_one(struct pci_dev *pdev, 
 
 	return 0;
 
+probe_failed_rmhost:
+	scsi_remove_host(host);
+
 probe_failed:
 	qla2x00_free_device(ha);
 
_

Patches currently in -mm which might be from jeff@xxxxxxxxxx are

origin.patch
fix-up-a-multitude-of-acpi-compiler-warnings-on-x86_64.patch
cpufreq-handle-sysfs-errors.patch
drm-fix-error-returns-sysfs-error-handling.patch
git-dvb.patch
drivers-media-video-handle-sysfs-errors.patch
i2c-buses-scx200_acb-handle-pci-errors.patch
input-handle-sysfs-errors.patch
input-drivers-handle-sysfs-errors.patch
git-libata-all.patch
ata-must-depend-on-block.patch
via-pata-controller-xfer-fixes.patch
ahci-ati-sb600-sata-support-for-various-modes.patch
drivers-mmcmisc-handle-pci-errors-on-resume.patch
git-mtd.patch
git-netdev-all.patch
libphy-dont-do-that.patch
update-smc91x-driver-with-arm-versatile-board-info.patch
8139too-force-media-setting-fix.patch
tulip-fix-shutdown-dma-irq-race.patch
drivers-dma-handle-sysfs-errors.patch
atm-firestream-handle-thrown-error.patch
wan-pc300-handle-propagate-minor-errors.patch
pcmcia-handle-sysfs-pci-errors.patch
r8169-driver-corega-support-patch.patch
git-pciseg.patch
scsi-minor-bug-fixes-and-cleanups.patch
mpt-fusion-handle-pci-layer-error-on-resume.patch
git-watchdog.patch
airo-suspend-fix.patch
drivers-led-handle-sysfs-errors.patch
i2o-handle-a-few-sysfs-errors.patch
fs-partitions-check-add-sysfs-error-handling.patch
rtc-fix-printk-of-64-bit-res-on-32-bit-platform.patch
i2o-more-error-checking.patch
pnp-handle-sysfs-errors.patch
rtc-handle-sysfs-errors.patch
sound-oss-emu10k1-handle-userspace-copy-errors.patch
scsi-aha1740-handle-scsi-api-errors.patch
scsi-qla2xxx-handle-sysfs-errors.patch
serial-handle-pci_enable_device-failure-upon-resume.patch
spi-improve-sysfs-compiler-complaint-handling.patch
usb-gadget-net2280-handle-sysfs-errors.patch
net-atm-handle-sysfs-errors.patch
net-bluetooth-handle-sysfs-errors.patch
isdn-fix-drivers-by-handling-errors-thrown-by-readstat.patch
isdn-check-for-userspace-copy-faults.patch
atyfb-rivafb-minor-fixes.patch
md-conditionalize-some-code.patch
git-gccbug.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux