Эх сурвалжийг харах

[GFS2] Fix glock hash clearing

A one liner bug fix to prevent the return value being
wrong when more than one superblock is mounted.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Steven Whitehouse 18 жил өмнө
parent
commit
a8336344a5
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      fs/gfs2/glock.c

+ 1 - 1
fs/gfs2/glock.c

@@ -1892,7 +1892,6 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp,
 	/* Can't use hlist_for_each_entry - don't want prefetch here */
 	/* Can't use hlist_for_each_entry - don't want prefetch here */
 	if (hlist_empty(head))
 	if (hlist_empty(head))
 		goto out;
 		goto out;
-	has_entries = 1;
 	gl = list_entry(head->first, struct gfs2_glock, gl_list);
 	gl = list_entry(head->first, struct gfs2_glock, gl_list);
 	while(1) {
 	while(1) {
 		if (gl->gl_sbd == sdp) {
 		if (gl->gl_sbd == sdp) {
@@ -1902,6 +1901,7 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp,
 				gfs2_glock_put(prev);
 				gfs2_glock_put(prev);
 			prev = gl;
 			prev = gl;
 			examiner(gl);
 			examiner(gl);
+			has_entries = 1;
 			read_lock(gl_lock_addr(hash));
 			read_lock(gl_lock_addr(hash));
 		}
 		}
 		if (gl->gl_list.next == NULL)
 		if (gl->gl_list.next == NULL)