scsi: libsas: add event to defer list tail instead of head when draining
authorchenxiang <chenxiang66@hisilicon.com>
Wed, 6 Sep 2017 09:15:14 +0000 (17:15 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 16 Sep 2017 01:38:30 +0000 (21:38 -0400)
commit7f6ab5693f66e5a638925f28e17ea7576fc69f2f
treef1fcf4c097830a9a616ae3f1730a03054cc9fec7
parent5956d8e6bdfc08f5609f59aa00015acbc4ce1bdf
scsi: libsas: add event to defer list tail instead of head when draining

Events will be added to defer_q list when setting ha->status to
SAS_HA_DRAINING. Events will be called after drain workqueue.

Those events are added to the head of list, but they are scanned one by
one from the head to the tail, which will cause those events be called
in the reverse order of being added. So change list_add to list_add_tail
in function sas_queue_work.

Signed-off-by: chenxiang <chenxiang66@hisilicon.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
CC: John Garry <john.garry@huawei.com>
CC: Johannes Thumshirn <jthumshirn@suse.de>
CC: Ewan Milne <emilne@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
CC: Tomas Henzl <thenzl@redhat.com>
CC: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libsas/sas_event.c