diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2022-03-17 14:20:38 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-09 09:14:39 +0200 |
commit | fe24959a79c9c036e377adaff44beee81a58d5ff (patch) | |
tree | c51556dfa6355589db70c233481e278580da7531 /fs | |
parent | e4ea3286b1aa136e478779a791260a8f8d9e77f4 (diff) | |
download | linux-stable-fe24959a79c9c036e377adaff44beee81a58d5ff.tar.gz linux-stable-fe24959a79c9c036e377adaff44beee81a58d5ff.tar.bz2 linux-stable-fe24959a79c9c036e377adaff44beee81a58d5ff.zip |
gfs2: Minor retry logic cleanup
[ Upstream commit 124c458a401a2497f796e4f2d6cafac6edbea8e9 ]
Clean up the retry logic in the read and write functions somewhat.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/file.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 97e2793e22d7..964c19e27ce2 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -858,9 +858,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)) @@ -927,9 +927,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: @@ -996,12 +996,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)) @@ -1075,12 +1074,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: |