Skip to content

Commit 6feaec8

Browse files
author
Andreas Gruenbacher
committed
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>
1 parent 0befb85 commit 6feaec8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/gfs2/glock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,11 @@ int gfs2_instantiate(struct gfs2_holder *gh)
534534

535535
static int do_promote(struct gfs2_glock *gl)
536536
{
537-
struct gfs2_holder *gh, *tmp, *current_gh;
537+
struct gfs2_holder *gh, *current_gh;
538538
bool incompat_holders_demoted = false;
539539

540540
current_gh = find_first_strong_holder(gl);
541-
list_for_each_entry_safe(gh, tmp, &gl->gl_holders, gh_list) {
541+
list_for_each_entry(gh, &gl->gl_holders, gh_list) {
542542
if (test_bit(HIF_HOLDER, &gh->gh_iflags))
543543
continue;
544544
if (!may_grant(gl, current_gh, gh)) {

0 commit comments

Comments
 (0)