diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2022-06-11 05:00:23 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2022-06-29 17:01:59 +0200 |
commit | 6feaec81477af0390a41470cbd6b353f68dd853c (patch) | |
tree | 3f856d7566dd4b7ad4b58ad3e58008ca44057877 /fs | |
parent | gfs2: do_promote glock holder stealing fix (diff) | |
download | linux-6feaec81477af0390a41470cbd6b353f68dd853c.tar.xz linux-6feaec81477af0390a41470cbd6b353f68dd853c.zip |
gfs2: List traversal in do_promote is safe
In do_promote(), we're never removing the current entry from the list
and so the list traversal is actually safe. Switch back to
list_for_each_entry().
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/glock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 2138460a7369..e79f17d6d001 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -534,11 +534,11 @@ done: static int do_promote(struct gfs2_glock *gl) { - struct gfs2_holder *gh, *tmp, *current_gh; + struct gfs2_holder *gh, *current_gh; bool incompat_holders_demoted = false; current_gh = find_first_strong_holder(gl); - list_for_each_entry_safe(gh, tmp, &gl->gl_holders, gh_list) { + list_for_each_entry(gh, &gl->gl_holders, gh_list) { if (test_bit(HIF_HOLDER, &gh->gh_iflags)) continue; if (!may_grant(gl, current_gh, gh)) { |