Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1727276 > unrolled thread

[PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining

Started byJason Yan <yanaijie@huawei.com>
First post2017-09-06 11:20 +0200
Last post2017-09-06 15:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining Jason Yan <yanaijie@huawei.com> - 2017-09-06 11:20 +0200
    Re: [PATCH v4 11/11] libsas: add event to defer list tail instead         of head when draining Christoph Hellwig <hch@lst.de> - 2017-09-06 15:30 +0200

#1727276 — [PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining

FromJason Yan <yanaijie@huawei.com>
Date2017-09-06 11:20 +0200
Subject[PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining
Message-ID<umEF4-81v-23@gated-at.bofh.it>
From: chenxiang <chenxiang66@hisilicon.com>

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>
---
 drivers/scsi/libsas/sas_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libsas/sas_event.c b/drivers/scsi/libsas/sas_event.c
index c120657..b124198 100644
--- a/drivers/scsi/libsas/sas_event.c
+++ b/drivers/scsi/libsas/sas_event.c
@@ -38,7 +38,7 @@ int sas_queue_work(struct sas_ha_struct *ha, struct sas_work *sw)
 	if (test_bit(SAS_HA_DRAINING, &ha->state)) {
 		/* add it to the defer list, if not already pending */
 		if (list_empty(&sw->drain_node))
-			list_add(&sw->drain_node, &ha->defer_q);
+			list_add_tail(&sw->drain_node, &ha->defer_q);
 	} else
 		rc = queue_work(ha->event_q, &sw->work);
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1727464 — Re: [PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining

FromChristoph Hellwig <hch@lst.de>
Date2017-09-06 15:30 +0200
SubjectRe: [PATCH v4 11/11] libsas: add event to defer list tail instead of head when draining
Message-ID<umIz4-2mH-57@gated-at.bofh.it>
In reply to#1727276
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web