The patch titled areca-raid-linux-scsi-driver-update7-fix-3 has been added to the -mm tree. Its filename is areca-raid-linux-scsi-driver-update7-fix-3.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: areca-raid-linux-scsi-driver-update7-fix-3 From: Erich Chen <erich@xxxxxxxxxxxx> 1- fix the return value of sysfs read / write Signed-off-by: Erich Chen <erich@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/scsi/arcmsr/arcmsr_attr.c | 55 +++++++++++++++++----------- 1 file changed, 35 insertions(+), 20 deletions(-) diff -puN drivers/scsi/arcmsr/arcmsr_attr.c~areca-raid-linux-scsi-driver-update7-fix-3 drivers/scsi/arcmsr/arcmsr_attr.c --- a/drivers/scsi/arcmsr/arcmsr_attr.c~areca-raid-linux-scsi-driver-update7-fix-3 +++ a/drivers/scsi/arcmsr/arcmsr_attr.c @@ -70,8 +70,8 @@ arcmsr_sysfs_iop_message_read(struct kob uint8_t *pQbuffer,*ptmpQbuffer; int32_t allxfer_len = 0; - if (!capable(CAP_SYS_ADMIN) || (off + count) > 1032 || (count && off) == 0) - return 0; + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; /* do message unit read. */ ptmpQbuffer = (uint8_t *)buf; @@ -115,9 +115,10 @@ arcmsr_sysfs_iop_message_write(struct ko int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; uint8_t *pQbuffer, *ptmpuserbuffer; - if (!capable(CAP_SYS_ADMIN) || (off + count) > 1032 || (count && off) == 0) - return 0; - + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + if (count > 1032) + return -EINVAL; /* do message unit write. */ ptmpuserbuffer = (uint8_t *)buf; user_len = (int32_t)count; @@ -125,7 +126,7 @@ arcmsr_sysfs_iop_message_write(struct ko wqbuf_firstindex = acb->wqbuf_firstindex; if (wqbuf_lastindex != wqbuf_firstindex) { arcmsr_post_Qbuffer(acb); - return 0; + return 0; /*need retry*/ } else { my_empty_len = (wqbuf_firstindex-wqbuf_lastindex - 1) &(ARCMSR_MAX_QBUFFER - 1); @@ -146,7 +147,7 @@ arcmsr_sysfs_iop_message_write(struct ko } return count; } else { - return 0; + return 0; /*need retry*/ } } } @@ -161,8 +162,8 @@ arcmsr_sysfs_iop_message_clear(struct ko struct MessageUnit __iomem *reg = acb->pmu; uint8_t *pQbuffer; - if (!capable(CAP_SYS_ADMIN) || (count && off) == 0) - return 0; + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; @@ -221,26 +222,33 @@ int arcmsr_alloc_sysfs_attr(struct Adapt error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr); - if (error) + if (error) { + printk(KERN_ERR "arcmsr: alloc sysfs mu_read failed\n"); goto error_bin_file_message_read; - + } error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr); - if (error) + if (error) { + printk(KERN_ERR "arcmsr: alloc sysfs mu_write failed\n"); goto error_bin_file_message_write; - + } error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_clear_attr); - if (error) + if (error) { + printk(KERN_ERR "arcmsr: alloc sysfs mu_clear failed\n"); goto error_bin_file_message_clear; - + } return 0; error_bin_file_message_clear: - sysfs_remove_bin_file(&host->shost_classdev.kobj, + error = sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr); + if (error) + printk(KERN_ERR "arcmsr: sysfs_remove_bin_file mu_write failed\n"); error_bin_file_message_write: - sysfs_remove_bin_file(&host->shost_classdev.kobj, + error = sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr); + if (error) + printk(KERN_ERR "arcmsr: sysfs_remove_bin_file mu_read failed\n"); error_bin_file_message_read: return error; } @@ -248,13 +256,20 @@ error_bin_file_message_read: void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb) { struct Scsi_Host *host = acb->host; + int error; - sysfs_remove_bin_file(&host->shost_classdev.kobj, + error = sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_clear_attr); - sysfs_remove_bin_file(&host->shost_classdev.kobj, + if (error) + printk(KERN_ERR "arcmsr: free sysfs mu_clear failed\n"); + error = sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr); - sysfs_remove_bin_file(&host->shost_classdev.kobj, + if (error) + printk(KERN_ERR "arcmsr: free sysfs mu_write failed\n"); + error = sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr); + if (error) + printk(KERN_ERR "arcmsr: free sysfss mu_read failed\n"); } _ Patches currently in -mm which might be from erich@xxxxxxxxxxxx are areca-raid-linux-scsi-driver.patch drivers-scsi-arcmsr-cleanups.patch areca-raid-linux-scsi-driver-update7.patch areca-raid-linux-scsi-driver-update7-fix.patch areca-raid-linux-scsi-driver-update7-fix-2.patch areca-raid-linux-scsi-driver-update7-fix-3.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