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]
Message-ID: <0d863efb-cb8c-4dfb-8d52-c73ad04b93e0@oracle.com>
Date: Mon, 8 Dec 2025 09:08:01 +0000
From: John Garry <john.g.garry@...cle.com>
To: wdhh6 <wdhh6@...yun.com>, yanaijie@...wei.com,
        James.Bottomley@...senPartnership.com, martin.petersen@...cle.com,
        dlemoal@...nel.org
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] scsi: libsas: Add rollback handling in the
 sas_register_phys() and sas_register_ha() when an error occurs.

On 06/12/2025 06:06, wdhh6 wrote:
> From: Chaohai Chen <wdhh6@...yun.com>
> 
> In sas_register_phys(), if an error is triggered in the loop process,
> we need to rollback the resources that have already been requested.
> 
> Add the sas_unregister_phys() when an error occurs in
> sas_register_ha().
> 
> Signed-off-by: Chaohai Chen <wdhh6@...yun.com>

Reviewed-by: John Garry <john.g.garry@...cle.com>

> +}
> +
> +void sas_unregister_phys(struct sas_ha_struct *sas_ha)
> +{
> +	int i;
> +	struct asd_sas_phy *phy;
> +
> +	for (i = 0; i < sas_ha->num_phys; i++) {
> +		phy = sas_ha->sas_phy[i];


nit: I think that it would be nicer to declare @phy within the loop, 
like how it is done at the roolback label in sas_register_phys().

> +		sas_phy_delete(phy->phy);
> +		sas_phy_free(phy->phy);
> +	}
>   }
>   
>   const work_func_t sas_phy_event_fns[PHY_NUM_EVENTS] = {


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ