Unverified Commit c81b4f78 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15679 list: fix a data-race around ep->rdllist

parents d289e187 7f404029
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
static inline void INIT_LIST_HEAD(struct list_head *list)
{
	WRITE_ONCE(list->next, list);
	list->prev = list;
	WRITE_ONCE(list->prev, list);
}

#ifdef CONFIG_DEBUG_LIST
@@ -296,7 +296,7 @@ static inline int list_empty(const struct list_head *head)
static inline void list_del_init_careful(struct list_head *entry)
{
	__list_del_entry(entry);
	entry->prev = entry;
	WRITE_ONCE(entry->prev, entry);
	smp_store_release(&entry->next, entry);
}

@@ -316,7 +316,7 @@ static inline void list_del_init_careful(struct list_head *entry)
static inline int list_empty_careful(const struct list_head *head)
{
	struct list_head *next = smp_load_acquire(&head->next);
	return (next == head) && (next == head->prev);
	return (next == head) && (next == READ_ONCE(head->prev));
}

/**