public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: wdhh6 <wdhh6@aliyun.com>,
	yanaijie@huawei.com, James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, dlemoal@kernel.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] scsi: libsas: Add rollback handling in the sas_register_phys() and sas_register_ha() when an error occurs.
Date: Mon, 8 Dec 2025 09:08:01 +0000	[thread overview]
Message-ID: <0d863efb-cb8c-4dfb-8d52-c73ad04b93e0@oracle.com> (raw)
In-Reply-To: <20251206060616.69216-1-wdhh6@aliyun.com>

On 06/12/2025 06:06, wdhh6 wrote:
> From: Chaohai Chen <wdhh6@aliyun.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@aliyun.com>

Reviewed-by: John Garry <john.g.garry@oracle.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] = {


  reply	other threads:[~2025-12-08  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-06  6:06 [PATCH v2] scsi: libsas: Add rollback handling in the sas_register_phys() and sas_register_ha() when an error occurs wdhh6
2025-12-08  9:08 ` John Garry [this message]
2025-12-09  3:09 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d863efb-cb8c-4dfb-8d52-c73ad04b93e0@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dlemoal@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=wdhh6@aliyun.com \
    --cc=yanaijie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox