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: <692abe7a-149f-c1bf-5f28-3e36cad81b5a@suse.de>
Date:   Wed, 14 Jun 2017 10:48:40 +0200
From:   Johannes Thumshirn <jthumshirn@...e.de>
To:     Yijing Wang <wangyijing@...wei.com>, jejb@...ux.vnet.ibm.com,
        martin.petersen@...cle.com
Cc:     chenqilin2@...wei.com, hare@...e.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org, chenxiang66@...ilicon.com,
        huangdaode@...ilicon.com, wangkefeng.wang@...wei.com,
        zhaohongjiang@...wei.com, dingtianhong@...wei.com,
        guohanjun@...wei.com, yanaijie@...wei.com, hch@....de,
        dan.j.williams@...el.com, emilne@...hat.com, thenzl@...hat.com,
        wefu@...hat.com, charles.chenxin@...wei.com,
        chenweilong@...wei.com, Yousong He <heyousong@...wei.com>
Subject: Re: [PATCH v2 1/2] libsas: Don't process sas events in static works

On 06/14/2017 09:33 AM, Yijing Wang wrote:
> Now libsas hotplug work is static, LLDD driver queue
> the hotplug work into shost->work_q. If LLDD driver
> burst post lots hotplug events to libsas, the hotplug
> events may pending in the workqueue like
> 
> shost->work_q
> new work[PORTE_BYTES_DMAED] --> |[PHYE_LOSS_OF_SIGNAL][PORTE_BYTES_DMAED] -> processing
>                                 |<-------wait worker to process-------->|
> In this case, a new PORTE_BYTES_DMAED event coming, libsas try to queue it
> to shost->work_q, but this work is already pending, so it would be lost.
> Finally, libsas delete the related sas port and sas devices, but LLDD driver
> expect libsas add the sas port and devices(last sas event).
> 
> This patch remove the static defined hotplug work, and use dynamic work to
> avoid missing hotplug events.
> 
> Signed-off-by: Yijing Wang <wangyijing@...wei.com>
> Signed-off-by: Yousong He <heyousong@...wei.com>
> Signed-off-by: Qilin Chen <chenqilin2@...wei.com>
> ---

[...]

>  static void notify_ha_event(struct sas_ha_struct *sas_ha, enum ha_event event)
>  {
> +	struct sas_ha_event *ev;
> +
>  	BUG_ON(event >= HA_NUM_EVENTS);
>  
> -	sas_queue_event(event, &sas_ha->pending,
> -			&sas_ha->ha_events[event].work, sas_ha);
> +	ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
> +	if (!ev)
> +		return;
GFP_ATOMIC allocations can fail and then no events will be queued *and* we
don't report the error back to the caller.



> index 64e9cdd..c227a8b 100644
> --- a/drivers/scsi/libsas/sas_init.c
> +++ b/drivers/scsi/libsas/sas_init.c
> @@ -111,10 +111,6 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr)
>  
>  void sas_hae_reset(struct work_struct *work)
>  {
> -	struct sas_ha_event *ev = to_sas_ha_event(work);
> -	struct sas_ha_struct *ha = ev->ha;
> -
> -	clear_bit(HAE_RESET, &ha->pending);
>  }

I don't really get why you need a stubbed out sas_hae_reset(). Can't we
just kill it if it doesn't have anything left to do?


-- 
Johannes Thumshirn                                          Storage
jthumshirn@...e.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ