Merge tag 'gfs2-4.11.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2...
[platform/kernel/linux-rpi.git] / fs / gfs2 / glock.c
index 94f50ca..a2d45db 100644 (file)
@@ -1802,16 +1802,18 @@ void gfs2_glock_exit(void)
 
 static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
 {
-       do {
-               gi->gl = rhashtable_walk_next(&gi->hti);
+       while ((gi->gl = rhashtable_walk_next(&gi->hti))) {
                if (IS_ERR(gi->gl)) {
                        if (PTR_ERR(gi->gl) == -EAGAIN)
                                continue;
                        gi->gl = NULL;
+                       return;
                }
-       /* Skip entries for other sb and dead entries */
-       } while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) ||
-                             __lockref_is_dead(&gi->gl->gl_lockref)));
+               /* Skip entries for other sb and dead entries */
+               if (gi->sdp == gi->gl->gl_name.ln_sbd &&
+                   !__lockref_is_dead(&gi->gl->gl_lockref))
+                       return;
+       }
 }
 
 static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)