[Devel] [PATCH 5/7] target: use to_stat_tgt_port() to handle files in scsi_tgt_port/

Evgenii Shatokhin eshatokhin at virtuozzo.com
Wed Jun 2 19:25:27 MSK 2021


On 02.06.2021 18:59, Alexander Mikhalitsyn wrote:
> From: Andrei Vagin <avagin at virtuozzo.com>
> 
> Currently we use to_stat_port(), but it has to be used only for files in
> scsi_port/.
> 
> https://pmc.acronis.com/browse/VSTOR-13021

The bug and the patch are for the in-kernel iSCSI target interface, 
which is no longer used in HCI/VIP/whatever (they use SCST).

I suggest to drop this patch for now. The less non-upstream patches the 
better.

> Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
> (cherry picked from commit 3de1aee7ed19aff5a1ce4e12aa356aa3db8bc2df)
> 
> VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127837
> 
> Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
> ---
>   drivers/target/target_core_stat.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
> index abe7f612b676..8d0f4f75829a 100644
> --- a/drivers/target/target_core_stat.c
> +++ b/drivers/target/target_core_stat.c
> @@ -544,7 +544,7 @@ static ssize_t target_stat_tgt_port_##_name##_show(			\
>   {									\
>   	ssize_t size = -ENODEV;						\
>   	struct se_device *dev;						\
> -	struct se_lun *lun = to_stat_port(item);			\
> +	struct se_lun *lun = to_stat_tgt_port(item);			\
>   									\
>   	rcu_read_lock();						\
>   	dev = rcu_dereference(lun->lun_se_dev);				\
> @@ -561,7 +561,7 @@ static ssize_t target_stat_tgt_port_##_name##_store(			\
>   	struct config_item *item, const char *page, size_t size)	\
>   {									\
>   	struct se_device *dev;						\
> -	struct se_lun *lun = to_stat_port(item);			\
> +	struct se_lun *lun = to_stat_tgt_port(item);			\
>   	struct scsi_port_stats_hist *old, *new;				\
>   	ssize_t ret;							\
>   									\
> @@ -894,7 +894,7 @@ static ssize_t target_stat_tgt_port_hs_in_cmds_show(struct config_item *item,
>   static ssize_t  target_stat_tgt_port_##_name##_show(			\
>   	struct config_item *item, char *page)				\
>   {									\
> -	struct se_lun *lun = to_stat_port(item);			\
> +	struct se_lun *lun = to_stat_tgt_port(item);			\
>   	struct se_device *dev;						\
>   	ssize_t ret = -ENODEV;						\
>   									\
> 

Regards,
Evgenii


More information about the Devel mailing list