]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
gfs2: Minor retry logic cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 17 Mar 2022 13:20:38 +0000 (14:20 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 23 Mar 2022 15:52:41 +0000 (16:52 +0100)
Clean up the retry logic in the read and write functions somewhat.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/file.c

index 44132e4c878909106b736189e69ab66e1a7b0bd2..44bb886eefce52efd0abd4400762ad96ce63e82b 100644 (file)
@@ -852,9 +852,9 @@ retry_under_glock:
                leftover = fault_in_iov_iter_writeable(to, window_size);
                gfs2_holder_disallow_demote(gh);
                if (leftover != window_size) {
-                       if (!gfs2_holder_queued(gh))
-                               goto retry;
-                       goto retry_under_glock;
+                       if (gfs2_holder_queued(gh))
+                               goto retry_under_glock;
+                       goto retry;
                }
        }
        if (gfs2_holder_queued(gh))
@@ -921,9 +921,9 @@ retry_under_glock:
                leftover = fault_in_iov_iter_readable(from, window_size);
                gfs2_holder_disallow_demote(gh);
                if (leftover != window_size) {
-                       if (!gfs2_holder_queued(gh))
-                               goto retry;
-                       goto retry_under_glock;
+                       if (gfs2_holder_queued(gh))
+                               goto retry_under_glock;
+                       goto retry;
                }
        }
 out:
@@ -992,12 +992,11 @@ retry_under_glock:
                leftover = fault_in_iov_iter_writeable(to, window_size);
                gfs2_holder_disallow_demote(&gh);
                if (leftover != window_size) {
-                       if (!gfs2_holder_queued(&gh)) {
-                               if (written)
-                                       goto out_uninit;
-                               goto retry;
-                       }
-                       goto retry_under_glock;
+                       if (gfs2_holder_queued(&gh))
+                               goto retry_under_glock;
+                       if (written)
+                               goto out_uninit;
+                       goto retry;
                }
        }
        if (gfs2_holder_queued(&gh))
@@ -1071,12 +1070,11 @@ retry_under_glock:
                gfs2_holder_disallow_demote(gh);
                if (leftover != window_size) {
                        from->count = min(from->count, window_size - leftover);
-                       if (!gfs2_holder_queued(gh)) {
-                               if (read)
-                                       goto out_uninit;
-                               goto retry;
-                       }
-                       goto retry_under_glock;
+                       if (gfs2_holder_queued(gh))
+                               goto retry_under_glock;
+                       if (read)
+                               goto out_uninit;
+                       goto retry;
                }
        }
 out_unlock: