[GFS2] Use list_for_each_entry_safe_reverse in gfs2_ail1_start()
This is an attempt to fix Red Hat bz 204364. I don't hit it all the time, but with these changes, running postmark which used to trigger it on a regular basis no longer appears to. So I'm not saying that its 100% certain that its fixed, but it does look promising at the moment. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
parent
7d308590ae
commit
74669416f7
@ -62,8 +62,9 @@ void gfs2_ail1_start(struct gfs2_sbd *sdp, int flags)
|
|||||||
{
|
{
|
||||||
struct list_head *head = &sdp->sd_ail1_list;
|
struct list_head *head = &sdp->sd_ail1_list;
|
||||||
u64 sync_gen;
|
u64 sync_gen;
|
||||||
struct list_head *first, *tmp;
|
struct list_head *first;
|
||||||
struct gfs2_ail *first_ai, *ai;
|
struct gfs2_ail *first_ai, *ai, *tmp;
|
||||||
|
int done = 0;
|
||||||
|
|
||||||
gfs2_log_lock(sdp);
|
gfs2_log_lock(sdp);
|
||||||
if (list_empty(head)) {
|
if (list_empty(head)) {
|
||||||
@ -75,27 +76,25 @@ void gfs2_ail1_start(struct gfs2_sbd *sdp, int flags)
|
|||||||
first = head->prev;
|
first = head->prev;
|
||||||
first_ai = list_entry(first, struct gfs2_ail, ai_list);
|
first_ai = list_entry(first, struct gfs2_ail, ai_list);
|
||||||
first_ai->ai_sync_gen = sync_gen;
|
first_ai->ai_sync_gen = sync_gen;
|
||||||
gfs2_ail1_start_one(sdp, first_ai);
|
gfs2_ail1_start_one(sdp, first_ai); /* This may drop log lock */
|
||||||
|
|
||||||
if (flags & DIO_ALL)
|
if (flags & DIO_ALL)
|
||||||
first = NULL;
|
first = NULL;
|
||||||
|
|
||||||
for (;;) {
|
while(!done) {
|
||||||
if (first && (head->prev != first ||
|
if (first && (head->prev != first ||
|
||||||
gfs2_ail1_empty_one(sdp, first_ai, 0)))
|
gfs2_ail1_empty_one(sdp, first_ai, 0)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for (tmp = head->prev; tmp != head; tmp = tmp->prev) {
|
done = 1;
|
||||||
ai = list_entry(tmp, struct gfs2_ail, ai_list);
|
list_for_each_entry_safe_reverse(ai, tmp, head, ai_list) {
|
||||||
if (ai->ai_sync_gen >= sync_gen)
|
if (ai->ai_sync_gen >= sync_gen)
|
||||||
continue;
|
continue;
|
||||||
ai->ai_sync_gen = sync_gen;
|
ai->ai_sync_gen = sync_gen;
|
||||||
gfs2_ail1_start_one(sdp, ai);
|
gfs2_ail1_start_one(sdp, ai); /* This may drop log lock */
|
||||||
|
done = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp == head)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gfs2_log_unlock(sdp);
|
gfs2_log_unlock(sdp);
|
||||||
|
Loading…
Reference in New Issue
Block a user