lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Feb 2018 00:38:25 +0000
From:   Bart Van Assche <Bart.VanAssche@....com>
To:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "jaegeuk@...nel.org" <jaegeuk@...nel.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        Stanislav Nijnikov <Stanislav.Nijnikov@....com>
CC:     Alex Lemberg <Alex.Lemberg@....com>
Subject: Re: [PATCH v4 08/10] ufs: sysfs: unit descriptor

On Thu, 2018-02-01 at 18:15 +0200, Stanislav Nijnikov wrote:
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index cbc0fe2..69a6a1f 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -1309,6 +1309,14 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
>  		}
>  	}
>  
> +	if (sdev->host->hostt->sdev_groups) {
> +		error = sysfs_create_groups(&sdev->sdev_gendev.kobj,
> +			(const struct attribute_group **)
> +			sdev->host->hostt->sdev_groups);
> +			if (error)
> +				return error;
> +	}
> +
>  	scsi_autopm_put_device(sdev);
>  	return error;
>  }
> @@ -1326,6 +1334,12 @@ void __scsi_remove_device(struct scsi_device *sdev)
>  	if (sdev->sdev_state == SDEV_DEL)
>  		return;
>  
> +	if (sdev->host->hostt->sdev_groups) {
> +		sysfs_remove_groups(&sdev->sdev_gendev.kobj,
> +			(const struct attribute_group **)
> +			sdev->host->hostt->sdev_groups);
> +	}
> +
>  	if (sdev->is_visible) {
>  		/*
>  		 * If scsi_internal_target_block() is running concurrently,

Please split this patch into two patches, namely one patch that introduces
the sdev_groups attribute in the SCSI core and a second patch that does not
modify the SCSI core but only the UFS driver. That will make these changes
easier to review.

Additionally, it seems wrong to me to cast the third argument of
sysfs_create_groups() and sysfs_remove_groups() from a non-const to a const
pointer. Please consider to declare the sdev_groups member const and also
the corresponding data structures in the UFS driver.

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ